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.

Mon Mar 26, 2018 8:37 am

Hallo,

I have a pdf-file and I want to print this document.

Bevor the print I have a PrintDialog tu select Printer and his Settings (Color, douplex…).

The Document must print exactly (Position top, left, no Margin, no pagefit).

I have found a "old" Variant wich is deprecated:
Code: Select all
 pdoc.PrinterName = Settings.DruckerReKopie.PrinterName
                    pdoc.PrintDocument.PrinterSettings = Settings.DruckerReKopie
                    pdoc.PrintDocument.DefaultPageSettings = Settings.DruckerReKopiePage


How can I solve this in the new Syntax? (pdoc.printsettings)

Thanks. Uwe

UweGabbert
 
Posts: 10
Joined: Mon Mar 05, 2018 9:25 am

Mon Mar 26, 2018 10:35 am

Hello Uwe,

Thanks for your post. Please refer to the below code to accomplish your task. If any question, please write back to us.
Code: Select all
           
            PdfDocument pdf = new PdfDocument();
            pdf.LoadFromFile(fileName);
            pdf.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.ActualSize);
            pdf.PrintSettings.Color = true;                     
            pdf.PrintSettings.Duplex = Duplex.Vertical;
            pdf.Print();


Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Fri Mar 30, 2018 8:01 am

Hello Uwe,

Is the solution I provided helpful to you?
Your feedback will be greatly appreciated.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Return to Spire.PDF