Skip to main content
A newer version of this page is available. .

How to: Use the PDF Printer Settings

  • 2 minutes to read

Important

The Universal Subscription or an additional Document Server Subscription is required to use this example in production code. Please refer to the DevExpress Subscription page for pricing information.

This example shows how to print a document with custom printer settings.

' Developer Express Code Central Example:
' How to use the PDF printer settings

Imports DevExpress.Pdf

Namespace PdfProcessorPrinterOptions
    Friend Class Program

        Shared Sub Main(ByVal args() As String)
            ' Create a Pdf Document Processor instance and load a PDF into it.
            Dim documentProcessor As New PdfDocumentProcessor()
            documentProcessor.LoadDocument("..\..\Demo.pdf")

            ' Declare the PDF printer settings.
            Dim pdfPrinterSettings As New PdfPrinterSettings()

            ' Specify the PDF printer settings.
            pdfPrinterSettings.PageOrientation = PdfPrintPageOrientation.Portrait
            pdfPrinterSettings.PageNumbers = New Integer() { 1, 3, 4, 5 }

            ' Setting the PdfPrintScaleMode property to CustomScale requires 
            ' specifying the Scale property, as well.
            pdfPrinterSettings.ScaleMode = PdfPrintScaleMode.CustomScale
            pdfPrinterSettings.Scale = 90

            ' Print the document using the specified printer settings.
            documentProcessor.Print(pdfPrinterSettings)
        End Sub
    End Class
End Namespace
See Also