Print Page | Close Window

PrintDocument prints strange characters

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2107
Printed Date: 29 Jan 26 at 7:12AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: PrintDocument prints strange characters
Posted By: that0th3rGuy
Subject: PrintDocument prints strange characters
Date Posted: 20 Jan 12 at 12:17PM
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




Replies:
Posted By: AndrewC
Date Posted: 24 Jan 12 at 12:40AM
Can you please send the PDF document to the QPL Support via  http://www.quickpdflibrary.com/support/support-query.php - http://www.quickpdflibrary.com/support/support-query.php

The problem seems to be font related but I won't know until I see the document.

Your document will be treated as confidential.

Andrew.



Posted By: that0th3rGuy
Date Posted: 24 Jan 12 at 6:29AM
Good day,

Thank you for taking the time to consider my question and responding to it.

I submitted the files you requested and the case number for this query is 10200.

I said this in the email as well, but just to be safe:

test.pdf
This file is the one created by printing via QuickPDF's PrintDocumentToFile() method.

tmpE69A.pdf
This file is the one created by fetching the byte[] from the database and writing it to disk.

Thank you for your time and assistance.

Kind regards,
Hannes.

**EDIT: Got the two files mixed up; corrected.


Posted By: AndrewC
Date Posted: 24 Jan 12 at 1:54PM
This problem has been fixed in the 8.13 release of Quick PDF Library.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk