Can I use the PDF-XChange print driver from Delphi 5 to save a Quick Report as a PDF file without user intervention?
Question:
Can I use the PDF-XChange print driver from Delphi 5 to save a Quick Report as a PDF file without user intervention?
Please note that a user asked this question on the Tracker Software forum. They wanted to adjust the print driver settings programatically in order to suppress the Save As dialog box, specify a PDF filename/location and save to the file without the knowledge of the user. Additionally, they wanted to use a different print driver in order to print a hard copy for the user at the same time as the above.
The user's approach had been to print the hard copy and then programatically set the printer as the PDF printer and call the Quick Report print method. Their hope was that as they were not using the PDF-XChange APIs (such as PXC_WriteDocumentExA) it would be possible to change the print driver settings, programatically, each time a report was printed, and control how files were saved.
Answer:
Yes - the Drivers API SDK can be used for this purpose. A sample code (in Delphi 5) is detailed below:
Sample Code:
iPXCC: IPXCControlEx;
iPXCP: OleVariant;
begin
iPXCC := CoCPXCControlEx.Create;
try
Key := '...';
DevCode := '...';
iPXCP := iPXCC.Get_Printer('', 'PDF-XChange 4.0', Key, DevCode);
iPXCP.Option['Saver.ShowProgress'] := 0;
iPXCP.Option['Save.SaveType'] := 'Save';
iPXCP.Option['Save.ShowSaveDialog'] := 0;
iPXCP.Option['Save.File'] := 'C:\'
iPXCP.Option['Save.WhenExists'] := 'AutoNumber';
iPXCP.Option['Save.RunApp'] := 0;
... Print QuickReport ...
finally
iPXCC := nil;
end;
end;
More Like This
-
KB#72: How do Icopy an image from an existing PDF file to a new PDF file and retain the original dimensions?
-
KB#227: I have an issue using the PDF-XChange SDK sample code with Microsoft Visual Basic in 'Interactive Mode' for debugging.
-
KB#50: Error when running application scheduled task
-
KB#34: How do Idistribute the PDF-XChange driver to my clients? Which files do I need in order to deploy my SDK-created application?
-
KB#51: I have a problem with my web application making calls to PXCLIB40.dll when running in 64 bit development environment