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 Jan 30, 2018 8:53 am

Hello,
I'm tring to print a pdf both sides. I set the Duplex.Vertical property to doc.PrinterSettings but it always print on one side. In debug I always seen the property CanDuplex with false value. My printer can print duplex and the printer name is setted before into PrinterSettings. Why the CanDuplex is always false? How can I print on both sides?
Thankhs in advance.

Degiorgi
 
Posts: 17
Joined: Thu Nov 02, 2017 3:22 pm

Tue Jan 30, 2018 10:21 am

Hello,

Thanks for your inquiry.
Please use the System.Drawing class to test you printer and tell us the result on your side.
Code: Select all
System.Drawing.Printing.PrinterSettings ps = new PrinterSettings();
bool s = ps.CanDuplex;


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Thu Feb 01, 2018 9:38 am

Hi,

Good day!
How is your issue now?
Your feedback would be greatly appreciated.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Thu Feb 01, 2018 2:59 pm

Hello,
Code: Select all
System.Drawing.Printing.PrinterSettings ps = new PrinterSettings();
bool s = ps.CanDuplex;


the vale of s variable is always false

On an other printer it works fine.

thanks

Degiorgi
 
Posts: 17
Joined: Thu Nov 02, 2017 3:22 pm

Fri Feb 02, 2018 8:31 am

Hi,

Thank you for your response.
Unfortunately, our spire.Pdf is based on the System.Drawing class in the print function.
Please try to select the double-sided option in the printing preferences and tell us the name of the printer that has problem.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Sun Feb 11, 2018 9:29 am

Hello,

Regarding the issue, how is it now?
Your feedback would be greatly appreciated.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Sun Mar 12, 2023 5:15 pm

Hello,

I was wondering how I can utilize the Duplex print setting to give the option to print double sided or single sided. This code seems like it would work but it always prints whatever the default settings are.

Code: Select all
PdfDocument pdf = new PdfDocument();
pdf .LoadFromFile("test.pdf");

SpirePrintOptions options = new SpirePrintOptions() // custom object
options.IsDuplex = false; // this value is set by the input.

if (options.IsDuplex && pdf.PrintSettings.CanDuplex)
    pdf.PrintSettings.Duplex = Duplex.Vertical;
else
    pdf.PrintSettings.Duplex = Duplex.Simplex;



Thanks,

Sam

okirisx2
 
Posts: 2
Joined: Thu Mar 09, 2023 1:11 am

Mon Mar 13, 2023 8:53 am

okirisx2 wrote:Hello,

I was wondering how I can utilize the Duplex print setting to give the option to print double sided or single sided. This code seems like it would work but it always prints whatever the default settings are.

Code: Select all
PdfDocument pdf = new PdfDocument();
pdf .LoadFromFile("test.pdf");

SpirePrintOptions options = new SpirePrintOptions() // custom object
options.IsDuplex = false; // this value is set by the input.

if (options.IsDuplex && pdf.PrintSettings.CanDuplex)
    pdf.PrintSettings.Duplex = Duplex.Vertical;
else
    pdf.PrintSettings.Duplex = Duplex.Simplex;



Thanks,

Sam


Hi Sam,

Thanks for your inquiry.
I tested your code but I did not reproduce your issue, I can enable duplex or simplex printing based on the conditions. Could you please provide us with the following messages to help us work out a solution for you? You can send them to us via email (support@e-iceblue.com) or attach them here. Thanks for your assistance.
1) the details about your physical printer.
2) the version of Spire.PDF you are using.
3) your application type, such as Console App .NET Framework 4.8.

Sincerely,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Mar 13, 2023 4:37 pm

Hi,

1) the details about your physical printer.
HP Color LaserJet Managed MFP E786dn Printer series
2) the version of Spire.PDF you are using.
Using Spire Office 8.2.2
3) your application type, such as Console App .NET Framework 4.8.
OutputType=WinExe
TargetFramework=net6.0

okirisx2
 
Posts: 2
Joined: Thu Mar 09, 2023 1:11 am

Tue Mar 14, 2023 8:14 am

Hi,

Thanks for your feedback.
After testing, I still did not reproduce your issue, the printer we use is HP Color LaserJet MFP M281fdw. To help resolve this issue, we would like to ask if you know what your default printer settings are, duplex or simplex? we suggest that you try debugging the code to check if the single or double-sided printing setting was successfully applied.
Additionally, we recommend trying a different printer to see if the issue persists. This will help determine if the problem is related to the printer or the software.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.PDF