The DomPDFPrint function is used to print any PDF file to an attached printer.
Note: The DomPDFPrint function does not support printing of encrypted PDF files. If printing of encrypted PDF files is required please contact Primeapple for details.
LOTUSSCRIPT
Declarations
Declare Function DomPDFPrint Lib "DOMINOPDF.DLL" (Byval szInput As String, Byval szPrinterName As String, Byval iStartPage As Integer, Byval iEndPage As Integer, Byval iPageScaling As Integer, Byval iAutoRotateCenter As Integer) As Long
Return Value
Returns 0 if successful or -1 if unsuccessful.
Syntax
szInput - A file name and path of PDF file to print.
For example;
c:\my documents\contacts.pdf
szPrinterName - The name of the active printer to print to.
This is the printer name that appears in the Windows Print Manager.
For example;
HP Laserjet 4L
Leaving the value empty ("") will print to the default printer on the machine.
iStartPage - The first page to print.
iEndPage - The last page to print.
If the number of pages is unknown the DomPDFPages function can be used.
iPageScaling - Control how to fit pages on a page.
This controls how printed pages are sized on the physical page. Options are as follows;
0 - No Scaling
1 - Fit To Paper
2 - Shrink large pages
iAutoRotateAndCenter - Control how to rotate pages on a page.
This controls how printed pages are rotated on the physical page. Options are as follows;
0 - Do not rotate pages automatically.
1 - Rotate pages to fit on the paper and center on the page.
Example
Sub Initialize
'Declare variables...
Dim sInput As String
'Set values...
sInput = |c:\test.PDF|
'Error handler...
On Error Goto Error_Handler
'Print PDF file...
Call DomPDFPrint(sInput, "HP Laserjet 4L", 1, 5, 1, 0)
Call DomPDFPrint(sInput, "", 1, 5, 1, 0)
The_End:
Exit Sub
Error_Handler:
Print Error$
Resume The_End
End Sub