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.

Thu Apr 02, 2020 10:32 pm

Hello .. Good night!
I'm using sdk printing methods.
In A4 or letter documents printing is normal.
If I submit a document of a different size, such as A3, the printer does not understand and prints as A4.
Below, an excerpt from my code

Dim PrintPDF As New PdfDocument
PrintPDF.LoadFromFile("C:\Files\PdfA3.pdf")
Dim Pags As Integer = PrintPDF.Pages.Count
PrintPDF.PrintSettings.PrintController = New StandardPrintController
PrintPDF.PrintSettings.PrinterName = Fila
PrintPDF.PrintSettings.Collate = True
PrintPDF.PageSettings.Orientation = PdfPageOrientation.Portrait
PrintPDF.PrintSettings.Duplex = Drawing.Printing.Duplex.Vertical
PrintPDF.PrintSettings.Color = False
PrintPDF.PrintSettings.DocumentName = "PDF A3"
PrintPDF.PrintSettings.Copies = 1
PrintPDF.Print()

Do I need to define something in order for the job to be submitted with the correct paper specifications for the printer?
Thanks in advance for your attention.

gafforelli
 
Posts: 37
Joined: Sat Sep 15, 2018 6:38 pm

Fri Apr 03, 2020 6:22 am

Hello,

Thanks for your inquiry.
Please refer to the below code snippet to print according to the paper size of the document. If there is any question, please provide your input file for further investigation. You could send it to us([email protected]) via email.
Code: Select all
        'Get the paper size of the first page, the unit is Point
        Dim size As SizeF = PrintPDF.Pages(0).Size
        'Convert the unit
        Dim paper As PaperSize = New PaperSize("Custom", CInt(size.Width / 72 * 100), CInt(size.Height / 72 * 100))
        paper.RawKind = PaperKind.Custom
        'Set paper size
        PrintPDF.PrintSettings.PaperSize = paper
        PrintPDF.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.FitSize, False)
        '...
        'Your other settings
        PrintPDF.Print()


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Apr 03, 2020 7:34 pm

Hi Rachel!
P.E.R.F.E.C.T!!!
Identification worked!
Thank you very much for the quick response.
Att

gafforelli
 
Posts: 37
Joined: Sat Sep 15, 2018 6:38 pm

Mon Apr 06, 2020 1:21 am

Hi,

Thanks for your feedback.
We are glad to hear from you that it helps.
Feel free to contact us if you need any help.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3044
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF

cron