How To…Send Each Page as a PDF

Question

“Is it possible to create a new PDF file for each page in the report?”

Solution

This can be done by manually taking control of the StartJob/EndJob routines of the TppDevice.  Start by creating a generic TppDevice object, assigning its OnPageReceive event and calling PrintToDevices.  Next implement the OnPageReceive event to create a PDF Device, start a new job, send the page, and end the job.  This will fire for each page of the report effectively creating a new PDF file for each page.

Download: SendEachPageAsNewPDFFile.zip

Sample Delphi code: