How to print PDF file?

Hi.

I have some PDF document,now I want to print the document,I also need some different parameters for each document printing。

Some document may be select pages to print.
Some document may be select Multiple .

Aspose.pdf cant do that?

Hi Michael,

Thanks for your inquiry. You may accomplish your requirement with the PrintRange property of the PrinterSetting object. Please check the Aspose.Pdf printing options and the sample code snippet to use the subjected properties.

// Create objects for printer and page settings and PrintDocument
System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings();
System.Drawing.Printing.PageSettings pgs = new System.Drawing.Printing.PageSettings();

// Specify your printer name
ps.PrinterName = myPrinterName;
ps.PrintRange = System.Drawing.Printing.PrintRange.SomePages;
ps.FromPage = 1;
ps.ToPage = 2;

// Set PageSize (if required)
pgs.PaperSize = new System.Drawing.Printing.PaperSize("A4", 827, 1169);

// Set PageMargins (if required)
pgs.Margins = new System.Drawing.Printing.Margins(0, 0, 0, 0);

// Here you can set the PaperSource which you want to use as per your printer.
pgs.PaperSource = ps.PaperSources[1];

// Print document using printer and page settings
<>

Please feel free to contact us for any further assistance.

Best Regards,

Thank you. I know set FromPage and ToPage solve the first problem(Pages to print),but how to set Multiple and page order? I found PdfFileEditor had MakeNUp function .So why PdfViewer din’t fount this function?




Hi Michael,

Thanks for your feedback.

lucy1667008715:
Thank you. I know set FromPage and ToPage solve the first problem(Pages to print),but how to set Multiple and page order? I found PdfFileEditor had MakeNUp function .So why PdfViewer din't fount this function?




I am afraid I did not get your point. Did you mean that PdfFileEditor fulfilled your requirements.

Moreover, using PdfViewer for multiple pages printing you can create different printing jobs for each range and also can control the order with it. Please check the documentation to create different printing jobs with different page range. Hopefully it will help you to accomplish the task.

Please feel free to contact us for any further assistance.

Best Regards,

I had some pdf file and I want to print the pdf file.But I must setting Print properties.Some pdf file only setting Pages to print.Some paf file only setting Multiple (Pages per sheet and page order).Some pdf file setting Pages to print and Multiple.

But when I used PrinterSettings only setting FromPage and ToPage,and now how to setting Multiple (Pages per sheet and page order)?

Hi Michael,


Thanks for providing additional information. We have logged an enhancement ticket PDFNEWNET-38159 in our issue tracking system for further investigation and resolution. We will keep you updated about the issue resolution progress within this forum thread.

Moreover, as a workaround you can save your PDF document to memory stream after using MakeNUp option and later pass it to PdfViewer object for printing.

We are sorry for the inconvenience caused.


Best Regards,