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 Aug 30, 2018 12:11 pm

Hello,

I want to print pdf file without the print dialog in c#.

I saw the examples here but the code not working in the new version.

how can I do it?

AlexeiL
 
Posts: 3
Joined: Thu Aug 30, 2018 10:02 am

Fri Aug 31, 2018 2:56 am

Dear Alexei,

Thanks for your inquiry.
We made adjustments in newer version. Please use below code to achieve silent printing.
Code: Select all
PdfDocument doc = new PdfDocument();
doc.LoadFromFile("sample.pdf");
//silent printing
doc.PrintSettings.PrintController = new StandardPrintController();
doc.Print();

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Fri Aug 31, 2018 7:13 am

Hey,

I got error with that example.

CS1061 'PdfDocument' does not contain a definition for 'PrintSettings' and no accessible extension method 'PrintSettings' accepting a first argument of type 'PdfDocument' could be found (are you missing a using directive or an assembly reference?)

I'm using spire.pdf.wpf

AlexeiL
 
Posts: 3
Joined: Thu Aug 30, 2018 10:02 am

Fri Aug 31, 2018 7:41 am

Hello,

Thanks for your quick response.
I' am regret to tell you that currently our Spire.Pdf for WPF doesn’t support silent printing (without PrintDialog), we will consider adding it as a new feature into out upgrade list, if it is available in the future, we will let you know. Sorry for the inconvenience caused.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Fri Aug 31, 2018 7:54 am

Thanks for the quick response.
BTW where can I found the difference betwen Spire.pdf vs Spire.pdf.wpf

AlexeiL
 
Posts: 3
Joined: Thu Aug 30, 2018 10:02 am

Fri Aug 31, 2018 10:00 am

Hi,

Sorry we have no particular description to show the differences. You could download the Spire.PDF Pack Version:4.0 msi, after installing it, you will find many live demos of WPF and other platforms. If you encounter any questions, you could contact us. We are always here to help.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1385
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.PDF