Print Page | Close Window

PDF to Image conversion issue

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=3862
Printed Date: 19 Apr 24 at 4:05AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: PDF to Image conversion issue
Posted By: rizzz86
Subject: PDF to Image conversion issue
Date Posted: 18 Nov 20 at 2:58PM
I am using Debenu (12.12.1.0) library to convert PDF documents into images.

In one of the PDF document the output image is not correct. The output image shows some data got swapped.

The PDF file is:
https://drive.google.com/file/d/1v39_l5rrl7PppObJN1vNxR04Z5ByCySF/view

And the generated image is:
https://drive.google.com/file/d/1osyuRzRT3AfolwvigcCT0_30THPn6CmS/view

I am using following function to get image of the loaded PDF:
QP.RenderDocumentToFile(210, 1, QP.PageCount(), 5, tempFile);

Please confirm if the issue is reproducible on your side.



Replies:
Posted By: tfrost
Date Posted: 18 Nov 20 at 4:02PM
I like testing our own rendering program with 'problem' PDFs so I downloaded your file and tested, but with version 18.11 of QPDF.  There is something unusual about this PDF, because I found that the two images on the first page were rendered rotated by 90 degrees (and we do call NormalizePage on each page before rendering).  I suggest sending the link to Foxit support and raising a support case.  You could also try switching renderers to PDFIUM, because the raw PDFIUM rendering works fine here; but I do not remember if QPDF 12 supported this rendering option within the library, or when this was added.


Posted By: rizzz86
Date Posted: 21 Nov 20 at 7:58PM
Thanks @tfrost for your comments, it helps.

The switching of renderer to PDFIUM rederer is not supported in Debenu 12 so I tried it with Debenu 18 and it worked.

But I cannot just directly switch to PDFIUM renderer in all the cases as the issue that I am facing is rare.

Please suggest if there is a way to identify that whether the PDF is unusual and it requires PDFIUM renderer to be used instead of default renderer. If there is a way then way to identify it using Debenu then I will only apply PDFIUM renderer when needed.

rizzz86


Posted By: tfrost
Date Posted: 22 Nov 20 at 12:28PM
We have the same issue of not always knowing which rendering is the best to use, but be aware that my solution is not going to suit everyone. We have been users of QPDF since v7, principally for rendering PDF to TIF, but also for creating and editing/annotating PDFs. In the early years there were often 'edge cases' where the rendering was incorrect, mainly for CJK documents, but also some others; Debenu were usually able to fix these in the next release, but not always. Most of our users do not control the PDFs which are to be rendered, and silently creating incorrect output was an unwelcome feature. So PDFIUM seemed a safer choice. As you have discovered, PDFIUM is more likely to support all the edge cases.

As a result, since 2016 our default rendering solution has been PDFIUM, using the DLL packaged for Delphi by Winsoft, which we found just before Debenu released a PDFIUM option in v13. We stuck with Winsoft because they seem to add support for new PDFIUM DLL versions more frequently than QPDF, but if I was choosing today I would probably use the QPDF PDFIUM option.  Yes, for both solutions there is an extra DLL to deliver and update, but we can manage this. 

We continue to use QPDF for all PDF applications other than rendering; it has many more features and is much easier to use, and we have no reason to abandon our existing code to call PDFIUM directly. And we fall back to regular QPDF for rendering in several situations: (1) for applications where we have to render PDF documents using multiple threads in the same process; (2) after PDFIUM returns an 'unsupported' error or raises an exception; (3) as an option for users who have grown to prefer the QPDF rendering for their specific documents.


Posted By: rizzz86
Date Posted: 30 Nov 20 at 7:14AM
Thanks for the detail reply.

With your help now I know the fix for this issue.



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