Free Support Forum - aspose.com

Double-sided or duplex printing

I would think this would be easy: I have a .doc file that I want to print double-sided using Aspose.Words. Is doesn’t appear to be part of System.Drawing.Printing.PrinterSettings or Aspose.Words.Document. I just want to output the whole document as Double-Sided. Is it a property of the Word file / do I need to set this setting inside Word when I created/edited the document?

Any help would be great!

Thanks,

Damian

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. This option is called Duplex. Please see the following code:

Document doc = new Document(@"Test001\in.doc");

PrinterSettings printerSettings = new PrinterSettings();

printerSettings.PrinterName = @"\\192.168.0.2\hp LaserJet 1010 Series Driver";

printerSettings.Duplex = Duplex.Vertical;

doc.Print(printerSettings);

But please make sure your printer supports double-side printing. You can use CanDuplex property to check this:

Console.WriteLine(printerSettings.CanDuplex);

Hope this helps.

Best regards.