Do Aspose support PDF printing with Aspose.pdf.kit

Hi ,

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)

Thanks

Ravi

Hi Ravi,

Thank you very much for considering Aspose.

I have seen your requirements. Please, spare us some time so we could test it at our end. You'll be udpated with the results the earliest possible.

Regards,

Hi Ravi,

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.

viewer.PrintDocumentWithSettings(pagesetting, printersetting);

viewer.ClosePdfFile();

Please try this code snippet at your end. If you still find any issue please do let us know.

Regards,

Hi Latif,

Thanks for yor reply.

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);

viewer.PrintDocumentWithSettings(pgs, ps);
viewer.ClosePdfFile();

Thanks

Ravi

Hi Ravi,

Please share any of the PDFs you're having problem with. This will help us understand the problem and then resolve it.

We're sorry for the inconvenience.

Regards,

Hi Latif,

I Can't upload the documents that I am trying to print.

Instead can you try printing the W4(2009) pdf form. I tried printing the PDF, it prints plain text only.

Thanks

Ravi

Hi Ravi,

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.

Regards,

Hi Latif,

Here is PDF attached. When I printed this PDF I only see the text.

Hi Ravi,

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.

Regards,

Hi Latif,

I tried latest version. It did the magic. Now I am able to see the borders , lines and boxes etc.,

I am going to print different PDF's and compare the results.

I have couple of questions on this product:

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?

Thanks

Ravi

Also I see the PDF is right aligned an inch or so and it is truncating the text on the right side.

RaviReddy:

I have couple of questions on this product:

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.

Regards,

Hi Latif,

Thanks for the reply.

I noticed that the size of the pdf in the print queue is around 14MB while its size on the disk is 77KB.

Also it is taking long time to print the PDF from the application(atleast 3 minutes).

The PDF prints instantly when I print directly.

Thanks

Ravi

Hi Ravi,

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.

We're sorry for the inconvenience.

Regards,

Hi I followed the code above and receive a NULL Reference error when opening the document.

viewer.OpenPdfFile("");

I read that Apsose.PDF.KIT does not suport Acrobat Reader version 8.1.6 and above,

When will it support 1.6 and above or are there any other alternatives?

Thank you

Hi Len,

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.

Regards,

The issues you have found earlier (filed as 9588) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.