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

Printing ESC character to printer?

Status
Not open for further replies.

davidmekelburg

Programmer
Jul 23, 2003
2
US
Moving from Microfocus to Fujitsu and have many standard COBOL i/o reports that print directly to a printer. I have coded many HP PCL5 control commands in a copybook. To change a font, I just write the "print-record from choose-font-2".

choose-font-2 has the ESC character X'1B' in it.

It appears that Fujitsu does not allow me to send the "non-printable" characters to a printer but I can send it to a sequential file. Can anyone confirm this or provide me with easy workaround.

I using win2000 so the printer is defined as:

select out-file assign to "PRTNAME:\\server\printer".

What I get printed is all the control strings with a space where the ESC code should be followed by the text that should be bolded/new font/duplexed etc.

I don't want to define forms/control lines etc. There should be a way to write simple hex characters to a printer.

thanks
 
David -

I am familiar with this issue, but from an AcuCOBOL point of view, not Fujitsu. You can't send esc sequences to a Windows printer using the native (Windows) printer drivers. You have to have a way to avoid that. I believe AcuCOBOL allows an environment setting or something that tells the program to bypass the Windows printer driver and basically write to the LPT or COM port. You probably can't write to a network share directly; I'd guess you have to map the printer to a port.

Regards.

Glenn
 
I am able to print the esc character directly using MicroFocus NetExpress cobol, by assign the printer

"select out-file assign to printer "\\server\printer"

without changing anything else this worked.
 
I had that problem in the past..the only way is to write a spoolfile in ascii to disk and print it with a simple print-ocx. You can find several ocx's on the internet, but Fujitsu supplies one too (printit.ocx) for free.
I am creating/testing one now that has some special features I couldn't find in any other ocx. The deletion of the spoolfile after print, choosing a printer but restoring the previous default printer and a special page-break at the end of the last printed line (bankforms/ocr-b).
For now I guess the best choice is the printit.ocx.

Good luck.
Peter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top