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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a crash course

Status
Not open for further replies.

FFSProgrammer

Programmer
May 21, 2003
5
US
My company needs me to set up some statements to print on an HP LaserJet 4100 DTN. We just received the Technical Reference Manual set and there is nothing like an application-level tutorial in any of the books (so far as I can see).

We are operating off a UNIX server with Windows 2000, Windows XP, and Windows 95/98 clients running over a TCP/IP network. The software we use to print statements is custom-written in an interpreted programming language (my specialty). The interpreter uses a configuration file to make device assignments easy. It allows us to set up filters and override/specify modes.

I've been trying to incorporate PCL 5 escape sequences into what we call "raw mode" (supposedly unfiltered) output streams. All I get is garbage surrounding the text.

I decided to print the escape sequences and text to an ASCII file and then try to print that under Windows. Got little boxes where the escape characters should be on the output.

Can only print these files on a Win2K system through text applications like Word or Wordpad. When I run a CMD.EXE window and try to use the PRINT command, it gets hung up (I'm probably using the wrong printer reference, but I don't do network configurations and am not sure of what device name to use).

After spending the afternoon reading this forum and a half dozen other sites, I have been unable to find a concise example of an ASCII file that any fool should be able to load into Wordpad (or something standard on any Windows 2K system) and send to a PCL printer.

All I need to do is change some font sizes and reposition the cursor. No graphics (at this time). I can't even get the thing to change the size of the characters with generic commands (like print EXPANDED, change Lines Per Inch, etc.). Spacing remains the same. Am only trying to use Courier Font (printer is set for that already).

The only thing I noticed (when looking at the printer settings) is that the personality is set to AUTO instead of PCL.

Anyway, what's the best starting point? Once I see how to do something I can generally move ahead quickly. But if there is supposed to be an intuitive path into this stuff, I am NOT going to get it.

Any help/suggestions would be appreciated. Concrete examples (print 1 sentence like this, print 1 sentense LIKE THAT, etc.) will be EXTREMELY helpful.

Thanks in advance.

Do not have access to C, C++, VB, Java, or any of the usual languages. I do have access to Perl on the UNIX server (and I do some Perl programming so I could probably follow examples in Perl pretty easily).
 
I have customers using Theos server with Windows 2000 clients on the network and routinely sent reports to
HP compatible printer or dot matrix printers with no problems. Most of these reports are not fancy in the sense
of a income tax form for example (though I do those also).

Most of these reports either use compressed (condensed) print or normal 10cpi print for the reports.

using Chr$(27);"(10U";chr$(27);"(s0p10h12v0s0b0T"
for 10CPI print
using Chr$(27);"(10U";chr$(27);"(s0p16.66h8.5v0s0b0T"
for 16.66 CPI print.
the 10U uses the PC-8 symbol set which should also allow
the use of box drawing characters (for example chr$(196)
equivilent of "-") for use primarily as single/double underline characters (205 for double underline).

The main thing to remember is that capital letters signify the end of the sequence. so,
chr$(27);"(s0p10h12v0s0b0T"
is equivilent (but takes less space than)
chr$(27);"(s0P";chr$(27);"(s10H";chr$(27);"(s12V";chr$(27);"(s0S";chr$(27);"(s0B";chr$(27);"(s0T"

chr$(27);"_3" should select PCL mode (I think) if you need to do that.

If you are sending from Unix be sure that Unix is not
doing some translation through a driver of it's own before it ever gets to the printer.

 
How is the job being printed? Is UNIX printing it or is it being printed through the WINDOWS printing system?

What you are asking should be a trivial task if you control the application source.


Jim Asman
jlasman@telus.net
 
Thanks for the speedy reply. I believe there may be a driver (possibly two) involved on the UNIX side. That was why I wanted to learn how to do this manually from the Windows side. I know that Windows has its own drivers, and all the document programs will go through those drivers.

Will do a little more digging to see what device name my PC uses to get to the printer. I will try your code samples, too. I believe I have been inserting capital letters when combining sequences, so that may be part of my problem.

I suppose I have multiple problems. [smile]

 
Jlasman, sorry. Looks like you and I were posting at the same time.

Okay, the programming language I use is called Business Basic. It's a multiplatform interpreted language which maintains its own environment (intended to emulate the old minicomputer operating systems the original Business Basics ran under in the 1970s). This is a pre-Java multi-platform development tool.

The Business Basic interpreter uses its own print drivers that, among other things, intercept and process special mnemonic codes we can embed in the output stream. Normally, I would use those mnemonic codes to change my output attributes.

HOWEVER, I have to place text on a pre-printed form. I need to print the data twice, once in a very small font (not yet determined) and once in a normal size font (presumably COURIER 12PT or 10PT).

The BB interpreter uses a spooler to interface with the printer. I don't know how the spooler is set up. But for THIS particular printer, we have also inserted a barcode filter that lets us print barcodes in our output.

So, realizing the complexity of all the handshaking going on, I decided to see if I could streamline my efforts by testing some files in Windows. I guess I'm just trading off one set of drivers and filters for another.

I guess I have to ask the really dumb question. Can you use PCL THROUGH standard drivers? I get the impression that you cannot (especially since Buff1 said I need to be sure UNIX is not doing any translation through its own driver).
 
Then does your program hand the output to the UNIX printing system? Typically a UNIX interface may issue an init for the particular printer and in "cooked" mode may insert a FF to page the output, but raw mode should eliminate that. There could be some post processing going on, but...

If you want, give me a call at the office at (604)738-6112. That's on the west coast. It seems to me that you should generate the output to a file, and then send the resulting file to the UNIX printing system.




Jim Asman
jlasman@telus.net
 
We're comparing printer configurations at this point. It's a bit confusing for someone (like me) who didn't set it up and doesn't understand why things are being done the way they are.

I appreciate the offer of a direct phone call, but it would probably waste your time at this point.

My boss is traveling but he is answering questions through email. Hopefully, he and I will trip across something. He's actually got a program going to another (HP 4100) printer which sends escape sequences. But the two printers are on different servers, each with a different spooler.

I'll play with some different escape sequences to see if anything changes. Have also been trying to print in what the spooler deems "raw" mode. Not sure I'm doing that right.

I may be back with a few more questions when I am sure I understand exactly what my environment is doing.

Appreciate the help/interest.

 
There may be a way to bypass the driver filters.
THEOS multi-user basic is also a "business basic" and
they have used chr$(254) file bypass and chr$(255) character bypass to instruct the driver to not interpret
a certain file/and or character(s).

(this has only caused me problems - or at least redoing when raster graphics are involved - actually that's the
only time i use the bypass anyway).

 
I thought a little closure would be appropriate here, as I hate it when people ask for help and then never come back to say what works.

My boss found some time Monday to figure out how the printers were set up and to confirm that we were indeed passing character strings in raw mode. It turns out that we needed to set the pitch first and then start changing character sizes and line spacing.

While there may be other solutions to achieve the same effect, this is working for us. I have the control I need over the output I am producing.

I appreciate the suggestions everyone made.

 
I DO NOT HAVE A ANSWER TO THE ABOVE QUERY BUT I HAVE A QUESTION.
I WANRT TO PRINT BAR CODES TO 'ANY' TYPE OF PRINTER USING PCL STRUCTURES IN MY PROGRAMS. I AM USING UNIDATA/PICK AND WOULD LIKE TO PRINT BAR CODES AS OUR CUSTOMER WANTS TO MOVE AWAY FROM BEING DEPENDENT ON ONE TYPE OF PRINTER.
WHERE DO I LOOK OR INVESTIGATE WHAT THE ESCAPE SEQUENCES ARE AND HOW DO I CONSTRUCT THE PCL COMMAND IN MY CODE?
ANY HELP WILL BE APPRECIATIVE.

 
Assuming you are always printing to a PCL printer that supports soft font downloads, simply download the font to the printer at runtime.

Most inkjet printers do NOT support soft fonts. ALL LaserJets support soft font downloads.


Jim Asman
jlasman@telus.net
 
FFSProgrammer,

As a starting point, in order to establish sanity, have you tried printing the files from Unix (lp command)? Works great for me. I had the same problems you had on Windows, but never resloved them because I didn't really need to print from Windows - just Unix. What interpreted language are you using?

JNebi
 
FFSProgrammer,

As a starting point, in order to establish sanity, have you tried printing the files from Unix (lp command)? Works great for me. I had the same problems you had on Windows, but never resolved them because I didn't really need to print from Windows - just Unix. What interpreted language are you using?

JNebi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top