PDF Viewer ActiveX Control

PrinterSetPageRange 

 

Set the Page range when Print the PDF without display Print Dialog.

Public Function PrinterSetPageRange
  ByVal iFirstPage  As Integer ,_
  ByVal iLastPage  As Integer
 ) as bool

 

Parameter
Integer
iFirstPage - the first page you want to print
iLasttPage -the last page you want to print , you may pass -1, it will print all pages

Return Value
Return true if successful, otherwise return false.

Example

   

Visual Basic Syntax
PDFViewer1.PrinterOpenPDF "c:\yourfile.pdf"
PDFViewer1.PrinterSetPrinterName "Microsoft Print to PDF"
PDFViewer1.PrinterSetPageOrientation 0
PDFViewer1.PrinterSetPageRange 1, 10
PDFViewer1.PDFPrint
'when the form close, call the following code
PDFViewer1.PrinterClosePDF