Link to home
Start Free TrialLog in
Avatar of JackNaif
JackNaif

asked on

Printing PDF documents with Delphi

Hi, everybody.

I need a snippet that will open an existing PDF document, and print an arbitrary page from it.
If it takes any library or component to do it, it must be available free of charge (or must ship with Delphi 7).

It would be most desirable if it was also possible to print several separate pages as one single print job.

In pseudocode, it would look like this:

PDF_File.Open('C:\MyDoc.pdf');
PDF_File.StartPrintJob('SomePrinter'); // Default printer is just fine. I don't care
PDF_File.PrintPage(34);
PDF_File.PrintPage(122);
PDF_File.PrintPage(345);
PDF_File.ClosePrintJobAndDamnPrintIt; // :-)

To print pages 34, 122, and 345 without giving the chance of other users sending anything to the printer between one of my pages and another.

I also don't care if it is done directly with Delphi, or if it uses Automation to have Acrobat Reader do it.

Thanks very much for your help:

Jack
ASKER CERTIFIED SOLUTION
Avatar of shaneholmes
shaneholmes

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of simonet

Just to add to Shane's comment:

everyone that has Acrobat Pro or Acrobat Viewer installed has the ActiveX control installed on their computer (nowadays that means basically everyone), so there is no need for you to redistribute the activeX control along with your app.

Alex