×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

PCL in Visual Basic

PCL in Visual Basic

PCL in Visual Basic

(OP)
Hi,
Iam new to PCL. We want to create a packing slip using PCL in visual basic. Can you please tell what is needed to use PCL commands in Visual Basic. And if anyone has sample code for me to start with that will be great help.

Thanks
Kothi

RE: PCL in Visual Basic

Kothi,

Firstly, are you sure you should do it direct from VB without using a report writer?
 
But if you do want to do it straight from VB, here's some thoughts. You'll need to learn the PCL commands first.... somewhere in this board there's a url for electronic copies of the PCL manuals if you've not got them already. Once you figure out the commands you need, you need to create output strings in your VB code, to send to the printer. The escape code, which is part of each PCL command is Ascii character 27, so you need a Chr(27) in the strings at the appropriate point.

But here's the problem.... usually, when you use the printer object in VB to print with, it puts MORE PCL code round what you send (or PostScript, depending on the driver you use) and that messes the whole thing up.

So one of my colleagues found a reference at MicroSoft on how to do what they call Raw Printng, which is direct to the printer not thru' the driver. We experimented with it and it does work. Here's the url: http://support.microsoft.com/support/kb/articles/Q154/0/78.asp

In the VB code, you will see they create a string called sWrittenData which they send to the printer. If for example you make that string something like....

sWrittenData = Chr(27) & "(s4101T"

that would set the typeface to CG Times which is typeface number 4101. (The typeface command is esc(s#T where the # is the typeface number.)

You need to construct a whole lot of strings like that, each one with the commands to do what you want, and the text you want to print, of course.

HTH?


Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2

RE: PCL in Visual Basic

I have created an PCL/HPGL class (collection of methods & functions) in a 4gl called Progress that could be easily translated into VB, if you're interested. (jnebi@landam.com)

RE: PCL in Visual Basic

Are you sure that you want to write pcl directly. vb6 has a printer object thats very easy to use and can print to any windows printer

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close