Free Support Forum - aspose.com

Issues in PDF XPS Print

Hi Team,

PDF Contains 20 pages but 4 pages only printing(.xps format) while print the PDF.Please provide us the solution and also please provide code for inserting page numbers in PDF while convert from excel to PDF.

Used Code:

Aspose.Pdf.Facades.PdfViewer viewer = new Aspose.Pdf.Facades.PdfViewer();

viewer.BindPdf(pdfFilePath);

viewer.AutoResize = true;

viewer.Resolution = 600;

viewer.AutoRotate = true;

viewer.PrintPageDialog = true;

System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();

System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();

System.Drawing.Printing.PrintDocument prtdoc = new System.Drawing.Printing.PrintDocument();

ps.PrinterName = prtdoc.PrinterSettings.PrinterName;

pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);

pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);

viewer.PrintDocumentWithSettings(pgs, ps);

viewer.Close();

viewer.PrintLargePdf(pdfFilePath, pgs, ps);

Thanks and Regards

Saravanan.l

Saravananl:
PDF Contains 20 pages but 4 pages only printing(.xps format) while print the PDF.

Hi Saravanan,

Thanks for using our products.

When using the product in trial mode, only 4 pages are printed. Please ensure that license is properly instantiated. In case the problem still persists, please share the source PDF file so that we can test the scenario at our end.

Saravananl:
Please provide us the solution and also please provide code for inserting page numbers in PDF while convert from excel to PDF.
Please follow the instructions specified over Add Page Number Stamp in a PDF File