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.

Wed Jan 14, 2015 12:21 pm

Hi Guys

I am evaluating Spire.PDF. All going good apart from one issue I face. I need to control if the printing will be in duplex on a duplex printer.

My simple code is:

Dim doc As New PdfDocument()
doc.LoadFromFile(file)
doc.PrintDocument. <- Here i was expecting to find a duplex property ??


Is there some way to set up so the printed document will respect a duplex setting ?

Thanks

Andy

andyrennison
 
Posts: 1
Joined: Wed Jan 14, 2015 1:56 am

Thu Jan 15, 2015 1:44 am

Hello andyrennison,

Thanks for your inquiry.

For your requirement, please refer to the code below:
Code: Select all
'Indicate whether the printer supports duplex
Dim isDuplex As Boolean = pdf.PrintDocument.PrinterSettings.CanDuplex
'If so, set the printer's duplex setting: Default, Simplex, Horizontal, Vertical
pdf.PrintDocument.PrinterSettings.Duplex = Duplex.[Default]
'Then you can print
pdf.PrintDocument.Print()
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Fri Jan 16, 2015 8:30 am

Hello andyrennison,

Did you try the code snippet to control the printer? How is it going?

Looking forward to your response.
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Return to Spire.PDF