Print Page | Close Window

RenderPageToFile writes blank image for small PDFs

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=1198
Printed Date: 28 Sep 24 at 10:48PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: RenderPageToFile writes blank image for small PDFs
Posted By: jplamb
Subject: RenderPageToFile writes blank image for small PDFs
Date Posted: 03 Sep 09 at 10:39PM
I'm having a problem with some small PDF files when using the RenderPageToFile() with C#.  It seems like if a file is 50KB or less, I get a blank PNG image. 
 
I've tried multiple things: 
1. with the DA methods and without
2. with the 7.15 then the 7.14 library
3. using the method that writes to a byte[] array instead of directly to a file
 
- but I get the same results. 
 
I'd be happy to post examples of the files that are failing for me - and thanks for any help with this.



Replies:
Posted By: Ingo
Date Posted: 04 Sep 09 at 6:05AM
Hi JP!

I've done it with smaller files and it works (but using jpg).
So i think the problem is another one.
Are there any security options on the pdf... no printing, no copying, no access, ...?
Perhaps you can upload the files anywhere on a free webspace hoster and post the link here.

Cheers, Ingo



Posted By: jplamb
Date Posted: 04 Sep 09 at 3:15PM
Thanks, I appreciate it.  Here is a link a zip file with four files in it:
https://secure.strategyone.net/QuickPdfTests/QuickPdfTests.zip - https://secure.strategyone.net/QuickPdfTests/QuickPdfTests.zip
 
I have included:
1) a file named [this-file-works.pdf] which renders correctly
2) a file named [this-file-does-not-work.pdf] which renders an empty/blank image
3) a file named [first-page-works-second-page-does-not-work.pdf] where only the second page is rendered blank
4) my [program.cs] C# file that I am using to process these pdf files
 
Thanks again for your help here,
Johnny


Posted By: Ingo
Date Posted: 04 Sep 09 at 6:36PM
Hi!

I've got exactly the same problems.
I think it has to do with the dimensions:
"...
<</Type/XObject
/Subtype/Image
/Width 2550
/Height 3300
/BitsPerComponent 8
/ColorSpace/DeviceGray
/Length 9 0 R
/Filter/DCTDecode
..."

I've splitted the files ... Each page with these large image dimensions wasn't displayed.

I think the problem is the used pdf-engine:
PdfCompressor from CVISION Technologies

Cheers, Ingo

BTW: The Adobe Reader can show the pages but keep in mind: This product comes with a 100-mb-installation ;-)
Perhaps you should send your faulty pdf-files to Debenu directly.



Posted By: jplamb
Date Posted: 04 Sep 09 at 7:26PM
Ingo,
 
Thanks again for taking the time to look at these files, I really appreciate it. 
 
I'll look into the dimension issue and see if that is something I can change on my side.
 
I have also sent these files directly to Debenu - and hope to hear back from them about it. 
 
Thanks,
Johnny


Posted By: Shotgun Tom
Date Posted: 05 Sep 09 at 3:49AM
Hi JP:
 
I think you'll find that the producer (CVision) compressed these unviewable pages using JPEG2000 or JBIG2 image format.  Acrobat supports that format which is why you can view it in Reader.  FoxIt PDF reader offers a plug-in, otherwise you can't view it with their reader.  Many libraries just flat out don't support those image formats as of yet.
 
Tom


Posted By: Ingo
Date Posted: 05 Sep 09 at 3:34PM
Hi!

I don't think so 'cause there are documents made by pdfCompressor and the first page (scanned image) we can see and (only) the second page not.
So i think there should be another reason for the described behavior?

Cheers, Ingo
 


Posted By: Shotgun Tom
Date Posted: 05 Sep 09 at 4:02PM
Pretty sure that's the case, Ingo, although it is curious as to why one page is not J2000/JBIG and the other is. 
 
I tested it with the FoxIt J2000/JBIG plug-in. Sure enough, without the plug in the first page shows okay but not when you go to the second page you get the message that you need the plug in to display the second page.  If you put the plug-in back in then it displays the second page okay. 
 
I do believe different pages can have different compression techniques and that seems to be the case with that file.
 
Tom
 


Posted By: Ingo
Date Posted: 05 Sep 09 at 4:30PM
Yes. The plugin test is a good argument.

Cheers, Ingo


Posted By: jplamb
Date Posted: 08 Sep 09 at 5:07PM
Ingo and Shotgun Tom,
 
Thanks for the time you've spent helping me with this. 
 
I've now done a number of tests with the files I have and the root cause does seem to be related to the JBIG2 compression.  At least I now know the real reason this is happening for some files and not others.
 
Thanks again,
Johnny 


Posted By: lcarrere
Date Posted: 09 Sep 09 at 7:41AM
Hi,

It is a JBIG2 decoding issue. CVISION uses full features of jbig2 compression scheme including aggregate symbol coding which is a bit hard to decode. Therefore you will find some viewer such as old version of PDFSumatra which includes jbig2 decoder but can't decode some pages of your file.

Kind regards,

Loïc



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