Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
RenderPageToFile writes blank image for small PDFs |
Post Reply |
Author | |
jplamb
Beginner Joined: 03 Sep 09 Status: Offline Points: 4 |
Post Options
Thanks(0)
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.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
jplamb
Beginner Joined: 03 Sep 09 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
Thanks, I appreciate it. Here is a link a zip file with four files in it:
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
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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. |
|
jplamb
Beginner Joined: 03 Sep 09 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
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
|
|
Shotgun Tom
Senior Member Joined: 14 Aug 09 Location: Phoenix, AZ Status: Offline Points: 53 |
Post Options
Thanks(0)
|
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
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
Shotgun Tom
Senior Member Joined: 14 Aug 09 Location: Phoenix, AZ Status: Offline Points: 53 |
Post Options
Thanks(0)
|
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
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Yes. The plugin test is a good argument.
Cheers, Ingo |
|
jplamb
Beginner Joined: 03 Sep 09 Status: Offline Points: 4 |
Post Options
Thanks(0)
|
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
|
|
lcarrere
Debenu Quick PDF Library Expert Joined: 10 Jul 06 Location: France Status: Offline Points: 47 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store