Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Sep 10, 2024 8:47 pm

This code used to work in an earlier version of spirePDF
Code: Select all
    Function PrintPDF() As Boolean
        Dim doc As New PdfDocument
        doc.LoadFromFile(PdfDest)

        doc.PrinterName = strPrinterName
        doc.PrintFromPage = 1
        doc.PrintToPage = doc.Pages.Count

        Try
            doc.PrintDocument.PrintController = New Printing.StandardPrintController
            doc.PrintDocument.Print()
            Return True
        Catch ex As Exception
            ErrorMessage = ex.Message
            Return False
        End Try

    End Function



After updating to the latest library 10.2.0, this code doesn't compile.
Following properties and methods aren't there:
    PrinterName
    PrintFromPage
    PrintToPage
    PrintDocument

Please point me to the right direction on how to update my code.

yyp
 
Posts: 16
Joined: Thu Jun 15, 2017 10:54 pm

Tue Sep 10, 2024 8:58 pm

Specifically the change happens when upgrading from version 8.2.0 to 8.6.0

yyp
 
Posts: 16
Joined: Thu Jun 15, 2017 10:54 pm

Wed Sep 11, 2024 9:33 am

Hello,

We have upgraded the printing functionality in the new version. The printing method you are currently using has been deprecated. Please switch to the new method below.
Additionally, we recommend that you download the latest commercial version for testing. Compared to the free version, the commercial version has no printing page limits with applying license and includes more fixes and new features, ensuring greater stability and power. You can download the latest commercial version via the link below.
If you have any questions, please feel free to contact us.
Website download link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget download link: https://www.nuget.org/packages/Spire.PDF/10.8.1
Code: Select all
 doc.PrintSettings.PrinterName = "name"
        doc.PrintSettings.SelectPageRange(from,to)
       Try
            doc.PrintSettings.PrintController = New Printing.StandardPrintController
            doc.Print()
         Return True
      Catch ex As Exception
            ErrorMessage = ex.Message
            Return False
        End Try

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 283
Joined: Mon Jul 15, 2024 5:40 am

Return to Spire.PDF