Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print!

Status
Not open for further replies.

clegg

Programmer
Jan 25, 2001
98
GB
I currently have a VB program that prints barcode labels to the printer directly using the printer.print method.

It prints a box and some text and the barcodes are printed using a 3rd party control that prints using its own method, eg.

BC1.PaintAt Printer.hdc, (1440 / Printer.TwipsPerPixelX) + (iWidx * iWidth / Printer.TwipsPerPixelX), iBline, 2400 / Printer.TwipsPerPixelX, 576 / Printer.TwipsPerPixelY

I want to transfer this concept to the web. A remote supplier needs to be able to print these labels but I don't have a clue as to how printing works in vbscript.

The 3rd party control states this in the help file:
BarcodeX control has COM interface “CbarcodeX” and it has these methods;

CreateBMP(Filename, BarcodeType, BarcodeCaption, ShowText, Width, Height, StretchMode, FontName, FontSize)
CreatePNG(Filename, BarcodeType, BarcodeCaption, ShowText, Width, Height, StretchMode, FontName, FontSize)
GetPNGStream (BarcodeType, Caption, ShowText, Width, Height, StretchMode, FontName, FontSize)

Here’s VBScript example:

Dim bc
Set bc=CreateObject("BarcodeX.CBarcodeX.1")
bc.CreateBMP "c:\bcx.bmp",0,"1234567890",1,200,100,1,"Arial",12

bc.CreatePNG "c:\bcx.png",0,"1234567890",1,200,100,1,"Arial",12

or, for out-of-memory streaming

<%
dim bc
set bc=Server.CreateObject("BarcodeX.CBarcodeX.1")
Response.ContentyType="image/png"
Response.BinaryWrite bc.GetPNGStream(0,"123123123",1,320,240,0,"Arial",20)
set bc = Nothing
%>

I realise that its a lot to ask and I don't want to take advantage of anyone......but where the hell do I start??

TIA
Clegg
 
I should also add that I don't want to display all the barcodes in the browser - there could be as many as 20,000!!

All i want to do is create them in memory and then print them out dependant on information that has been dragged from a database

Clegg
 
To start simply... there is VBScript and then there is VBScript. That useless statement is trying to say that VBScript doesn't have much of a "life" outside of its container. There isn't any real "print" capability in VBScript itself.

There isn't a lot you'll be able to accomplish strictly server-side, which is probably where you are looking right now. ASP isn't going to give you a way to print remotely.

No, you'll have to do something more exotic. Maybe a custom ActiveX control embedded in the web page?
 
Also, you could use a custom ActiveX DLL in the web page, unless you need to have custom UI content.

If you do this, keep in mind that deployment issues are significant. You'll probably need to sign the dll or control. Most SE's won't let IE load and register a DLL or OCX that hasn't been signed, and a lot won't let IE do one that's been signed either. If you're doing this on an intranet basis, it can work a lot better, since you have some kind of control over the user end.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top