Print Page | Close Window

png image rendred was empty

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=3439
Printed Date: 15 May 24 at 3:52PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: png image rendred was empty
Posted By: Edysoft
Subject: png image rendred was empty
Date Posted: 13 Feb 17 at 1:19PM
Hi,
I'm using QuickPDFNet1212x64 library and when i call DARenderPageToFile method with the following params 1476395009, 1476395011, 5, 300, "C:\PageRender_0001.png" i got an empty image
despite that, the returned result value is 1 => 
1int32The page was rendered correctly and the image file was saved to disk

The pdf and generated image is located here: http://www.4shared.com/folder/6PUqQHD3/QuickPdf.html






Replies:
Posted By: tfrost
Date Posted: 13 Feb 17 at 2:12PM
You should show your actual code to enable people to see how you obtained the filehandle and pageref parameters: the actual values are of no help.  Then I expect someone will be able to suggest something to try.


Posted By: Edysoft
Date Posted: 13 Feb 17 at 2:46PM
I using this method to get filehandle 
 QuickPDFNet.PDFLibrary.Instance.DAOpenFileReadOnly( pdfFileFullPath, password );
and for the other parmameter 
pagehandle

 int pagehandle = QuickPDFNet.PDFLibrary.Instance.DAFindPage( fileHandle, pageNumber );

int result = QuickPDFNet.PDFLibrary.Instance.DARenderPageToFile
( fileHandle
, pagehandle
, GetPageRenderQuickPDFImageFormat( renderImageFormat )
, dpi
, imageFile.FullName
);

switch( result )
{
case 0: //Wrong file handle or page handle
{
throw new ArgumentException( "Invalid page number or pdf file specified !" );
}
case 1:
{
return imageFile;
}
case 2: //Cannot save to disk
{
throw new IOException( string.Concat( "Cannot save the page image rendering to ", pdfPageRenderImageFile, " !" ) );
}
default : 
{
throw new Exception( string.Concat( "Unknow quickpdf return code : ", result ) );
}


Posted By: Ingo
Date Posted: 13 Feb 17 at 7:32PM
png and pdf-page are looking the same for me (using Chrome)?

Cheers and welcome here,
Ingo



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



Posted By: Edysoft
Date Posted: 14 Feb 17 at 7:48AM
@Ingo: Yes they look like using chrome browser. You can download files as zip and you will see the difference


Posted By: Ingo
Date Posted: 15 Feb 17 at 7:27PM
The strange download site is not particularly trusting.
I don't wanna have few unknown things on my harddisk after using this site :(



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



Posted By: Edysoft
Date Posted: 20 Feb 17 at 9:01AM
think you Ingo
I shared the pdf and the generated image in google drive
https://drive.google.com/open?id=0B7zZhKfGfiFNWnBUa3RYTENybms



Posted By: Edysoft
Date Posted: 20 Feb 17 at 9:39AM
Originally posted by Edysoft Edysoft wrote:

thank you Ingo
I shared the pdf and the generated image in google drive
https://drive.google.com/open?id=0B7zZhKfGfiFNWnBUa3RYTENybms



I even tested with the new version and I had the same problem


Posted By: tfrost
Date Posted: 20 Feb 17 at 11:19AM
I successfully converted this PDF file to image using our application, but (a) we convert to BMP, and (b) we no longer use the DA functions (which had some rendering issues with PDFium in the latest build, though we no longer use the Debenu PDFium DLL), and (c) we use Delphi, not .Net.  But this confirms to me that there is nothing unusual or 'difficult' about your PDF file. I also tried to convert to PNG using Debenu PDF Tools Pro v3, but this was a 2014 version so based on a much earlier QPDF library: it crashed, but that has happened before.

I recommend trying the non-DA API functions to see if that helps.  As I said, there are some differences in rendering between the two function sets in the latest release.  If it works without DA but the DA functions are essential for you, then raise a support issue.


Posted By: Edysoft
Date Posted: 20 Feb 17 at 1:28PM
I have already used another method than "DARenderPageToFile"(RenderDocumentToFile) but it does not work because it generate an empty image


Posted By: Ingo
Date Posted: 20 Feb 17 at 6:27PM
Mmmmmh...
In your code snippet i can't find the unlock-function?



-------------
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