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

Free Support Forum - aspose.com

Print forst 4 pages of the pdf (or half of the pages of pdf) based on some condition

Hi,

I’m using Aspose.pdf licensed version.
I have a pdf with 8 pages.
I have a requirement to print only first 4 pages of the pdf document (or half of the pages of pdf) based on some condition programatically (or in code). The user doesn’t have an idea ‘how many pages he/she has to print’. I need to control the number of pages to print with in the code. Is there any way to do that in Aspose.pdf.

Hi Rajesh,


Thanks for your inquiry. You can easily accomplish your printing task using Aspose.Pdf. Please check the documentation link. You need following PrinterSettings class properties to print specified page range.

…<o:p></o:p>

…<o:p></o:p>

ps.PrintRange = PrintRange.SomePages;<o:p></o:p>

ps.FromPage = 1; //from;<o:p></o:p>

ps.ToPage = 4; // to;<o:p></o:p>

…<o:p></o:p>


Please feel free to contact us for any further assistance.


Best Regards,