We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Printing selected pages (1-3-5 vs 1-5)

In a .net console application, how can I print selected pages that do not adjoin one another? The PrinterSettings object only seems to provide the Selected enumeration with no place to programatically set the selection. The Application object in the MS Word Interopt takes a string argument for this in its PrintOut method but I see nothing comparable here. Any ideas?


Thanks for your request. I think in this case you can try using the following code:

Document doc = new Document("in.doc");
PrinterSettings settings = new PrinterSettings();
settings.PrinterName = "hp LaserJet 1010 Series Driver";
settings.PrintRange = PrintRange.SomePages;
settings.FromPage = 1;
settings.ToPage = 1;
settings.FromPage = 4;
settings.ToPage = 4;

Also please see the following link for more information:

Best regards,