|
Good day,
QuickPDF version 7.26 Platform Windows Forms Environment Visual Studio 2010
I am using QuickPDF to generate some documents and store them in a database. From there they can be viewed and printed.
When viewing the saved document, the byte[] is read from the database, a temporary file is created and the temporary file is opened in Adobe Acrobat; this file looks as expected. Printing from here also produces a document looking as expected. This tells me that generating the document with QuickPDF works.
However, using QuickPDF's methods to print the stored documents yield some odd results (refer to attached image below): - Using the PrintDocument() method to print directly to a printer produces a document as shown in the image (top half). I have tried using more than one printer with the same results.
- When using the PrintDocumentToFile() method produces a file which Adobe Acrobat can't open the file saying that the file is not a supported format or that the file is broken.
When inspecting the contents of the PDF documents - both the direct and QuickPDF ones - with a text editor one can clearly see the difference. The one created by QuickPDF's PrintDocumentToFile() method contains a bunch of intelligible gibberish whereas the direct one has a readable and very evident structure - as I understand, a PDF viewed as text should look. I also stepped the code and inspected the byte[] converted to string and it looked correct - same as the temporary file. This tells me that something goes wrong when QuickPDF is communicating with a printer - both Adobe PDF printer and the physical printers yielded the same seemingly corrupted document.
I opened the printer's settings to try and see if i could solve the problem but to no avail.
Thank you in advance to everyone taking the time to consider my situation. Any and all comments are greatly appreciated.
Kind regards, Hannes.
********
This is a scanned image of the printed documents: - Top: Created with QuickPDF's PrintDocument() method
- Bottom: Printed from a temporary file created from the byte[] in the database
|