How to print a PDF on an iSeries OUTQ?

I have several PDFs that are created using the iText package in Java. This creates the PDF files, stores them on the iSeries IFS, but doesn't offer any functionality for printing them.

We want the PDFs to be printable directly from the iSeries on user request using the OUTQ system. (None of our printers can print PDFs natively.) I have found several ways of doing it, but most require commercial packages and/or Windows servers to print them.

I have tried using Ghostscript (v8.54 running on the PASE system) but GS has a bug that prevents printing in Duplex and I can not find any updated versions since 8.54 where that bug may have been fixed. I have also tried a java class from Sun called PDFRenderer but that wouldn't work.

Can anyone suggest a method (preferably free) for printing duplex PDFs on user request from an iSeries using an iSeries OUTQ? It is essential that the iSeries is the only computer used in the whole process, but we do have AIX (PASE for i) and Java (on the iSeries) as additional tools if options are available using them.
Paul-BaileyAsked:
Who is Participating?
 
Gary PattersonVP Technology / Senior Consultant Commented:
What AS/400 OS version are you running?
What types of attached printers do you have, specifically?
Can you describe the specific Ghostscript Duplex printing bug that you are experiencing?  I've used this successfully, though I haven't tested duplex printing.
Can you describe the problem that you experienced with using the PDFRender class?  I've used this successfully (without duplex).

One though on Ghostscript:  Sounds like for some reason the PCL Duplex command isn't getting inserted.  Can you capture the GS PCL output to a file and post it here?  One simple solution might be to direct the GS output to a file, then write a simple little script to insert the PCL  "Duplex" command into the resulting output file at the appropriate point:

 <esc>&l1S

Then push the edited file to the printer and clean up.

- Gary Patterson
0
 
Paul-BaileyAuthor Commented:
When you ask these questions in haste, you miss out all the information! Sorry! :)

We are running i OS 6.1. The two printers nearest me are both HP laserjets, one is a 4250dtn and the other is a 1320tn.

Ghostscript works perfectly except for the duplex part of the print. The PDF is converted into a PCL file (device ljet4d), and I pass the -Duplex and -DDuplex command line options (I have seen both all over the 'net, so was unsure which was correct. Even after reading the manual pages.) I print the PCL document by copying it from the IFS to a *USERASCII PRTF object - using either of Scott Klement's PRTSPLF utility or FTP. Whichever printer I try prints the first page, sucks the first page back into the printer but then prints nothing on the rear side of the paper. Then the second page comes out and does the same, and finally the third page does the same. It is as though the duplex process wants to work but it prints the document's three pages on three seperate pieces of paper.. Before I used the -Duplex options, I would just get all three pages out without the "sucking back in", so I am reasonably certain that there are only three pages in the PCL document. Perhaps the duplex options are inserting blank pages or page breaks into the file?

The PDFRenderer class is completely different. I understand the Java language and how it works when I run it from windows, but I am not very sure about Java/400 and the classic JVM that I am told it is using. The PDFRenderer examples liberally sprinkled all around the net usually set up a PrintJob using the java.awt.print package, but when I call PrintJob I get a null pointer exception. I suspect there is a setup issue with the iSeries printers/OUTQs so I posted another question about that at the same time I posted this one.

I'll need to setup the PCL output file again and I can't do that until tomorrow now. I'll check your advice about the duplex code tomorrow and maybe post the PCL file here for you to look at. But I think that the duplex code is probably already in there as the printer behaves as though it is.
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
Agree: sounds like you are getting extra page breaks in the duplex document, with the net result a simplex document.  

Just to confirm:  

1) Do you have the same issue on both printers (there is an 06 Apr 2011 firmware update available for the 4250)?
2) Can you print duplex to both of these from Windows?

I'd really like to see a sample of the problem PCL output.  I think that will tell us a lot.

- Gary Patterson
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Paul-BaileyAuthor Commented:
I have the file ready and tested to make certain that it prints duplex but appears to have extra page breaks, and I am willing to pass it on to you (as I haven't a clue what to look for in the file.) However the print has some information on it that I do not want available on the internet to anyone. Can you tell me how to get the file to you without attaching it here?

I have the same issue on both printers, but I can print duplex to both printers from windows. Will that firmware update for the 4250 fix a problem with duplex printing? I am not seeing a problem duplex orinting except with this ghostscript conversion.
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
Understand and agree with the privacy concerns. Check out my EE profile for contact info.  

I'll pull out the relevant block (PCL only - none of the actual text) and post it with my response.

- Gary Patterson
0
 
Paul-BaileyAuthor Commented:
I've still not heard anything. Has there been any progress?
0
 
Paul-BaileyAuthor Commented:
Gary took the question home with him and continued some correspondence through email, but the I last heard from him some time back was with no solution but a hint that he could be hired as a consultant.

He gets part of the points for showing willing, but loses my respect for trying to get me to hire him.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.