PDF Viewer ActiveX Control

PrinterSetPageOrientation

 

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

Public Function PrinterSetPageOrientation
  ByVal iMode  As Integer
 ) as bool

 

Parameter
Integer
iMode
0 -  Portrait
1 - Landscape

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