We are considering aspose for printing our existing PDF documents.
Below are the requirements.
Automation (meaning no print dialog) Need to be specify printer paper source tray to print from (per each PDF) Multiple printers: example one PDF will print to a LaserJet. Another has to print to a Zebra label printer.
Acutally these are already posted in the forum long time ago( some one having the same requirements)
I have prepared a sample code snippet for you. This will help you automate the printing process using PdfViewer class. You can specify the printer name, paper source, and other attributes as well using PrinterSettings and PageSettings classes.
PdfViewer viewer = new PdfViewer(); viewer.OpenPdfFile(common.Path("test.pdf"));
System.Drawing.Printing.PrinterSettings printersetting = new System.Drawing.Printing.PrinterSettings(); printersetting.Copies = 1; //specify number of copies printersetting.PrinterName = "HP Officejet 4300 series"; // name of default printer to be used
System.Drawing.Printing.PageSettings pagesetting = new System.Drawing.Printing.PageSettings(); pagesetting.PaperSource = printersetting.PaperSources[1]; //assign paper source to pagesettings object //you can either specify the index of the tray or you can loop through the trays as well.
I tried the code and was able to print.But the pdf text is aligned a bit to right and got truncated.
Another major problem is that I don't see the solid lines that I have on the pdf.
They are simply ignored.
I see the PDF with only plain text. Below is the code that I used.
PdfViewer viewer = new PdfViewer(); viewer.OpenPdfFile(@"C:\sample.pdf"); viewer.AutoResize = true; //print the file with adjusted size viewer.AutoRotate = true; //print the file with adjusted rotation viewer.PrintPageDialog = false;//do not produce the page number dialog when printing System.Drawing.Printing.PrinterSettings ps = new System.Drawing.Printing.PrinterSettings(); PrintDocument prtdoc = new PrintDocument(); ps.PrinterName = prtdoc.PrinterSettings.PrinterName;
PageSettings pgs = new PageSettings(); // I think I just need one of these either papersize or papersource pgs.PaperSize = new System.Drawing.Printing.PaperSize("Legal", 850, 1400); pgs.PaperSource = ps.PaperSources[3]; pgs.Margins = new Margins(0, 0, 0, 0);
I'm afraid I couldn't understand which PDF you're referring to. Moreover, if you don't want to make the PDF public, then you can mark the post as private. This way, your file will be accessible only by the Aspose staff.
I have tried to print the document and it worked fine at my end. All the text along with the lines and boxes printed very well. I have attached the scanned copy of the printed document. Can you please try our latest version Aspose.Pdf.Kit 3.5.0.0?
If it doesn't help either, then please share the information regarding your system specifications, OS, and printer details.
We're sorry for the inconvenience, and looking forward to help you out.
1.Do this product support PDF printing on any printer with any type of drivers?
2.Do this product has any limitation on the size of the PDF that prints?
1. Yes, Aspose.Pdf.Kit for .NET can print on any printer type which is supported on Windows OS and works fine.
2. No, It doesn't explicitly specify any size limit on the PDF files which need to be printed.
Nevertheless, I would like to add that PdfViewer class is currently in beta, so if you find any issue please do let us know; we'll help you out.
RaviReddy:
Also I see the PDF is right aligned an inch or so and it is truncating the text on the right side.
You're right. I have noticed this problem and logged it as PDFKITNET-9588 in our issue tracking system. Our development team will be looking into the matter and you'll be updated with the results the earliest possible.
We're sorry for the inconvenience. If you find any further questions, please do let us know.
I have noticed the problem and logged the issue as PDFKITNET-9659 in our issue tracking system. Our team will be looking into the matter and you'll be updated as the issue is resolved.
Aspose.Pdf.Kit supports PDF version 1.6. Can you please share the PDF file you’re having problem with? We’ll investigate the issue at our end and update you accordingly.