|
-
Mar 28th, 2023, 06:36 PM
#21
Re: Save PDF file with VBs Printer Object
As the title says, this code is for saving PDF files with "VB's Printer object".
DataReport <> Printer object.
Anyway the code should work also transparently for any other component that used the StartDocA API.
But, you shouldn't mix DataReport commands with Printer.EndDoc, they are different objects/components.
For working with other components, you need to ensure that before starting a print job, the component will use the "Microsoft Print to PDF" driver for printing.
That's done for the Printer object in the sample code in the SelectPrinter procedure, but that will only select the current printer for the Printer object, not for other components.
I don't remember how to select the current printer in DataReport (look on internet, or in this forum, or ask in the general forum, or maybe someone seeing post it here).
And at the end, let the component (DataReport in this case) do the "EndDoc" for itself, don't call Printer.EndDoc because it has nothing to do.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|