Printing PDF file to a Printer Divice

JamesBowen

19+ years progress programming and still learning.
Printing PDF file to a Printer Device

Hi All

I am using the PDFInclude library from sys-pro and it's working great. Now that I have created the PDF file I now want to print the file to Laser Printer.

I am creating the PDF file on a Linux RH server and I am using CUPS to handle print jobs.

I have done some "googling" and cups is able to print PDF files. However the when I try and Print the PDF file, only the contents is printed and not the formatted document. So I get pages and pages of garbage.

Can any one help?

Example command:
lp -p 'hp9000' -o media=a4 -o sides=two-sided-long-edge -t "Notification Letter" xxxxxxxx.pdf




Side Note:
The first Time a tried to print, 10's of pages where being printed. So in my panic I hit the power button and cleared the print queue. When I turned it back on I was unable to communicate to the Printer. Some how I managed to screw up the NIC on the printer and we had to buy new NIC for the printer.
 
Success.

The problem that I was having was that the printer are setup for RAW printing. I would of have to send the printer control codes within the file stream.

Anyway I created a new Printer under cups called 'hp2200dev' and I used the "Postscript Generic" drivers.
I then used the following command:

lpr -P 'hp2200dev' -o media=a4 -o sides=two-sided-long-edge -o page-ranges=1 -T "Notification Letter" './Notification.pdf'

So now I can create PDF documents and print them from Linux. The additional printer job option is to print multi-paged documents on both side of the paper.

Originally I created the new printer using the "HP Laserjet" driver but it printed the images inside the PDF document a bit flat. The Postscript driver worked a treat.
 
Back
Top