Free Support Forum - aspose.com

Is it possible to print PDF directly from code without the use of the viewer?

In other words is it possible to use the ASPOSE PDF KIT to print pdf’s in the background?

Hi Christophe,

Yes, it is possible to print PDF files in the background using Aspose.Pdf.Kit. PdfViewer class provides this functionality; you can use either PrintDocument method or PrintDocumentWithSettings method.

Please try the samples at your end and if you find any issues or more questions, please do let us know.
Regards,

I used both methods, but they give the same result… Only a part of the first page is printed. If you print it directly from the pdf document, the document is scaled to 70% and both pages are printed. But with pdfViewer I can’t get the same result. Is there a solution?

Hi Christophe,

Please share the PDF you’re trying to print and having problem with. we’ll investigate the issue at our end and update you accordingly.

We’re sorry for the inconvenience.
Regards,

Hi Christophe,

I have tested the issue at my end using the attached problematic PDF. I couldn’t see the problem; in fact, the file was printed successfully. There is nothing missing in the printed output of this file (both pages). I have tested using Aspose.Pdf.Kit for .NET 3.7 and it worked fine. Can you please try the latest version at your end?

If problem persists then please do let us know.

We’re sorry for the inconvenience.
Regards,

With .NET2.0 and .NET3.5 it doesn't work. We don't use .NET3.7. Is there another solution to solve this problem?

Hi Christophe,

I meant the latest version of Aspose.Pdf.Kit which is 3.7. You can download it here. Which version of Aspose.Pdf.Kit are you using at your end? If you’re using the latest version (3.7) and problem still exists at your end then please share the details regarding your OS, Machine, and Culture information, so we could create the scenario at our end and reproduce the issue.

We’re sorry for the inconvenience.
Regards,

I’ve downloaded the latest version of aspose.pdf.kit, I’ve done some testing on a computer with .NET2.0 the result was the same as before. I also tested it on a computer with .NET3.5, in this case an error occured at the end of the program.

Hi Christophe,

We’re sorry for the inconvenience.

Can you please share the sample project you’re working with? Also, please share the details regarding your OS, Machine, Culture information and the printer you’re sending the print to. I’m afraid, in order to understand and then resolve the issue, we need to reproduce the problem at our end. This will help our team to see the situation clearly and then resolve it. If possible, can you please attach the scanned copy of your output as well?

We appreciate your patience and cooperation.
Regards,

Hi,

Did you receive the information you requested by email?

Do you have any feedback or questions at this moment?

The reason I'm asking is that this issue is currently blocking the go live of our customers project.

With kind regards,

Hi Christophe,

Yes, we have received the sample project via email. We’re investigating this issue and you’ll be updated the earliest possible.

We appreciate your patience.
Regards,

Hi Christophe,

Are you having this issue only on the ‘Microsoft Office Document Image Writer’ or on the physical printer too? In my testing, the issue occurs only when I print using Microsoft Office Document Image Writer, but not on my physical printer. Please confirm so we could move forward on this issue.

We’re sorry for the inconvenience.
Regards,

We tried it on 3 different printers. All with the same result.

Kinds regards,

We have to possibility to work via Webex.
You could remotely see what is happening on the pc of the developer.
Would this help you any further?

Also you mentioned you had an output.
Thus this output comes on 1 or 2 pages.
As we print it via adobe we have a 2 pages output printed on a A4.
On that last pages some extra text is mentioned.

Hi Christophe,

I have logged this issue as PDFKITNET-11165 in our issue tracking system. Our team will be looking into the matter in detail and you’ll be updated via this forum as the issue is resolved. If we’ll need any further information, we’ll let you know.

We’re sorry for the inconvenience.
Regards,

I just installed the application on my pc and it worked.

We had a look into the application and we detected two print commands:

loPdfPrinter.PrintLargePdf(vsFinalDocument, loPrinterSettings)
loPdfPrinter.PrintDocumentWithSettings(loPageSettings, loPrinterSettings)

The first one prints correctly but in the beginning to the default printer as the settings were not filled in.
As the default printer was a local fileprinter nobody saw that two printcommands had been enabled.

The second one only prints 1 page, but it was this command that was outputed to the printer.

So, it seems that our problem is solved and the mistake was on our side.

Hi Christophe,

Please confirm that it is working fine on your physical printer too.

Regards,

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


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

With acrobat reader you can set the page scaling to 'shrink to printable area'. How can you do it with pdfviewer. if I use PrintLargePdf("x.pdf", loPrinterSettings), it only scales the height and not the width. if I use PrintDocumentWithSettings(loPageSettings, loPrinterSettings) there is no scaling.

Can you give me a solution?