Print Page | Close Window

Unable to convert to images.

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=3301
Printed Date: 21 Sep 24 at 4:17AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Unable to convert to images.
Posted By: Ludwig
Subject: Unable to convert to images.
Date Posted: 05 Apr 16 at 7:05AM
I am using the licensed Android Version for Debenu Quick Pdf (12.12).
I am converting the Pages of a PDF file  into jpeg images using the following code:

 int fileHandle = mDQPL.DAOpenFile("file_path", password);
 int pageCount = mDQPL.DAGetPageCount(fileHandle);

for (int pageIndex = 1; pageIndex <= pageCount; pageIndex++) {
    
        int pageRef = mDQPL.DAFindPage(fileHandle, pageIndex);
        mDQPL.DARenderPageToFile(fileHandle, pageRef, DEBENU_JPEG_OUTPUT, DEBENU_IMAGE_DPI,
"image_file_path");

}

This code is working for most files, however there are some for which it generated blank jpeg images for the PDF pages. For example in the following pdf:
https://drive.google.com/file/d/0B_6Z82hoBteTMzhCNVlqa0xqSjQ/view?usp=sharing

when I attempted to convert it into image using the above code, all I got is:(For its first Page)
https://drive.google.com/drive/folders/0B_6Z82hoBteTVDVUMUxUcHNxMk0

Please note: when i used the windows version of the library, it managed to successfully convert the PDF into images.

How can i handle this?




Replies:
Posted By: Ingo
Date Posted: 05 Apr 16 at 7:37PM
Hi Ludwig,

i can only test with the windows version.
My app for rendering is made with 10.14 and it works fine with your files.
The android version of the library comes last - so you can post your problem on the official support page from Debenu (if it's a real error here isn't the right place 'cause nobody here in the USER-forum can change it).
But anyway leave this function and try another one for rendering.
Below a snippet from my code - perhaps this function works better for you, too:

// . . .
      lv_pwidth  := QP.PageWidth;
      lv_pheight := QP.PageHeight;
      if ( lv_pwidth > lv_pheight ) then
         lv_pmax := lv_pwidth
        else
         lv_pmax := lv_pheight;
      lv_dpi := Round(( lv_pmax * 72 ) / 692);

      If x_suchen = '' Then
         begin
            ProgressBar1.Position := 60;
            ProgressBar1.Repaint;
         end;

      Save_Cursor := Screen.Cursor;
      Screen.Cursor := crHourglass;    { Show hourglass cursor }

      targetfile := target + ExtractFileName(Edit1.Text) + '.jpg';
      QP.RenderDocumentToFile(lv_dpi, 1, QP.PageCount, 1, targetfile);

// . . .



-------------
Cheers,
Ingo



Posted By: Ludwig
Date Posted: 06 Apr 16 at 1:57AM
When i used the files with a Windows version of the Debenu Library. It did work fine. The problem appears only with the Android Version. I will post the problem on the support page for Debenu.


Posted By: Ingo
Date Posted: 06 Apr 16 at 6:49PM
Never the less you could try "my" suggestion with RenderDocumentToFile ;-)



-------------
Cheers,
Ingo




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