Unable to Print on AppServer - OpenEdge

rrojo7229

Member
Hi folks,

When we try print through AppServer like this:
/**********************************************/
FIND printer WHERE ROWID(printer) = oprPrinter NO-LOCK.
OUTPUT STREAM out-printer THROUGH
VALUE(printer.thru-spooler) PAGED.

PUT STREAM out-printer " TEST" SKIP.

OUTPUT STREAM out-printer CLOSE.
/*************************************************/

The value field printer.thru-spooler is "lp -s -d office"


In the Log Server does not appear no one message and in the Log Broker appear :

lp: unable to print file: client-error-document-format-not-supported

Without message error.

Do you have some idea?

Out environment: OpenEdge 10.1B - Linux RedHat

Thanks.

Kind Regards
Ricardo Olguin
 
The "lp" command is telling you that it has no idea what to do with plain text.

You should get the same error if you typed the following at the command line:

echo "Test" | lp -s -d office

Just guessing but perhaps your "office" printer is setup as a postscript only printer?
 
The "lp" command is telling you that it has no idea what to do with plain text.

You should get the same error if you typed the following at the command line:

echo "Test" | lp -s -d office

Just guessing but perhaps your "office" printer is setup as a postscript only printer?


Dear Tom,

Thanks for your fast answer.

The situation now is: the printer Matrix has the Printer Driver as "Text Only" and it prints through SO typing lp -s -doffice hosts.

The printer starts print through AppServer after changes the command from: lp -s -d office <file> to: lp -s -oraw -d office <file>.

But this solution DID NOT work to Laser Print... This printer, as well, has the Printer Driver as "Text Only" and when I send through SO typing lp -s -doffice2 <file> the file is printed but when I send through AppServer the printer does not print using: 'lp -s -d office2' OR 'lp -s -oraw -d office2'

Do you have some idea why the Laser Print does not work?

The Laser Print is setup as "Text Only" and the command used to print through AppServer is "lp -s -oraw -d office2".

When I setup the Driver Print as "PostScript" both Printers does not print.

Thanks Tom.

Kind Regards
Ricardo Olguin
 
I think that you need to stop and spend some time thinking about how you want to do printing.

Back in the days when I built such things as print subsystems I had a rule -- always send output to be printed to a temp file first. That rule decouples print problems from Progress. I could always examine the temp files to see if they were correctly built and if the print commands associated with them worked properly.

You also probably need a table of print commands to use with different sorts of output. Use one command for plain text, another for PostScript, one for PDF and yet another for "laser" (is this perhaps PCL?). Or, in theory anyway, you might be able to have a script at the OS level detect the output type for you or perhaps the print driver can figure it out but I've never had a lot of confidence in that sort of thing.
 
Hi Tom,

Yeah, I agree. But here we are migrating from Version 91.C to OpenEdge and I imagine there are hundreds of reports sending report directly to address printer.

And in the version 91C we do not have this problem...

What can we do?

Thanks.
Kind Regards.
Ricardo Olguin.


I think that you need to stop and spend some time thinking about how you want to do printing.

Back in the days when I built such things as print subsystems I had a rule -- always send output to be printed to a temp file first. That rule decouples print problems from Progress. I could always examine the temp files to see if they were correctly built and if the print commands associated with them worked properly.

You also probably need a table of print commands to use with different sorts of output. Use one command for plain text, another for PostScript, one for PDF and yet another for "laser" (is this perhaps PCL?). Or, in theory anyway, you might be able to have a script at the OS level detect the output type for you or perhaps the print driver can figure it out but I've never had a lot of confidence in that sort of thing.
 
If it is true that simply changing the version of Progress "causes" the problem then I would suspect that you have changed the code-page for output and that some sort of automated filter within the OS print processing now thinks that plain text is not plain text.

Compare your old v9 $DLC/startup.pf to your new OE10 $DLC/startup.pf.

(This is a fairly common occurrence when sending e-mail too. A symptom is that your users suddenly start complaining that plain text messages are showing up as attachments...)
 
Dear Tom,

Thanks again,

But the files are identical, it does not have difference between it.

Another idea?

Thanks.
Kind Regards
Ricardo Olguin


If it is true that simply changing the version of Progress "causes" the problem then I would suspect that you have changed the code-page for output and that some sort of automated filter within the OS print processing now thinks that plain text is not plain text.

Compare your old v9 $DLC/startup.pf to your new OE10 $DLC/startup.pf.

(This is a fairly common occurrence when sending e-mail too. A symptom is that your users suddenly start complaining that plain text messages are showing up as attachments...)
 
What are the contents of $DLC/startup.pf?

Are there any -cp* options being used anywhere else? Command lines, properties files or anywhere at all?

You might try adding a little debugging code to dump session:cpstream to a log file to confirm the value.

Are you using stream-io to create your output?
 
Hi Tom,

Thanks for your help.

Yeah, I confirmed the program running in the AppSeerver is using the same cpstream : ISO8859-1

The problem is sequence string.

Yeah, we use sequence strings to control Settings Printer (Landscape, Bold, Size Font).

When the report sends the sequence string to set up to Landscape the printer, the report is not printed.

I commented the spot where:

PUT STREAM out-printer CONTROL
/*Hp-Landscape
*/
Hp-font-roman8
Hp-pitch-16
Hp-linespace-8
Hp-stroke-xbold
Hp-point-8.

And now the report is printed.

The sequence string to set up to [Landscape] we are using is:

Hp-landscape = CHR(27) + CHR(38) + CHR(108) + CHR(49) + CHR(79).

I understood when you said send the report to a file and after that send to a printer, But here we do not have the printers installed in the clients; all printers are installed in the Linux Server.

So the programs can not use the DLL Windows to catch the Driver Printer.

Do you have another options to make the same? But without create temporary files.

Thanks.
Kind Regards,


What are the contents of $DLC/startup.pf?

Are there any -cp* options being used anywhere else? Command lines, properties files or anywhere at all?

You might try adding a little debugging code to dump session:cpstream to a log file to confirm the value.

Are you using stream-io to create your output?
 
I think you need to spend some time learning about how your Linux print subsystem works and then develop a programming strategy that will work well for you.
 
Hi Tom,

Ok. Let me try, just one more option.

Have you ever used Control Code in Stream to set up Carriage Return and Line Feed because,

Now the report is printing but just the first line of the header.

the command to print used is: lp -s -d office -o raw

This is the only way that I reached to print.

I can not find a solution where we need send the report to a file, if I choose this option we will need change hundreds of reports.

Thanks.


I think you need to spend some time learning about how your Linux print subsystem works and then develop a programming strategy that will work well for you.
 
That sounds like "stair stepping". The PCL command string that fixes it is <ESC>&k2G.

But that's just one more bit of duct tape. It doesn't sound to me like you have a coherent and viable strategy for your print process.
 
Dear Tom,

You are my Hero... rsrs...

Now the reports are printing in Laser Printers.... But just, I suppose, a last little problem, it is always printing 3 times, the same report after I put the sequence that you gave me:

PUT STREAM out-printer CONTROL
Hp-Landscape
Hp-font-roman8
Hp-pitch-16
Hp-linespace-8
Hp-stroke-xbold
Hp-point-8.
PUT STREAM out-printer CONTROL CHR(27) + "&k2G".

Do you know why is happening this now? It is printing 3 times for the same report.

Thanks Tom,
Kind Regards

That sounds like "stair stepping". The PCL command string that fixes it is <ESC>&k2G.

But that's just one more bit of duct tape. It doesn't sound to me like you have a coherent and viable strategy for your print process.
 
Dear Tom,

Ok. I found another sequence to fix the last problem it was printing 3 times.

CHR(27) + "&k2G" + CHR(32) + CHR(27) + "&l1X"

I understood what you mean, but I started just a couple of month in this company and we are migrating to Open Edge one of branches but I will suggest to change this process print - to send to a file first.

Anyway, thank you very much indeed. When I go to USA, I will take a Irish Wisky for you.

Thanks
Kind Regards
Ricardo Olguin

Dear Tom,

You are my Hero... rsrs...

Now the reports are printing in Laser Printers.... But just, I suppose, a last little problem, it is always printing 3 times, the same report after I put the sequence that you gave me:

PUT STREAM out-printer CONTROL
Hp-Landscape
Hp-font-roman8
Hp-pitch-16
Hp-linespace-8
Hp-stroke-xbold
Hp-point-8.
PUT STREAM out-printer CONTROL CHR(27) + "&k2G".

Do you know why is happening this now? It is printing 3 times for the same report.

Thanks Tom,
Kind Regards
 
Back
Top