pvginkel / PdfiumViewer

PDF viewer based on Google's PDFium.
Apache License 2.0
967 stars 418 forks source link

PdfDocument.Render producing blank pages #144

Closed mrbastian closed 6 years ago

mrbastian commented 6 years ago

I've been using the PdfDocument.Render method to convert PDF pages to images fairly reliably but I came across this PDF which is rendered as blank images. The PDF seems to render successfully using various other tools including in chromium (x64 version 63.0.3239.132). I'm using PDFViewer 2.13.0 and PdfiumViewer.Native.x86.v8-xfa.

Can anyone recommend any methods for troubleshooting further?

Parameters in this case are Render(, 2550, 3300, 300, 300, true)

79750-1213407-1990477.pdf page2 page1

mrbastian commented 6 years ago

Here's another example: A 5 page PDF that pdfium renders fine on all pages except page 4. On page 4, you can see the signature and some page noise, but all the text from the page is blank! See motion.png for the output from the Render method.

How is it that chromium renders it perfectly, but pdfium has this problem?

Motion.pdf motion

mrbastian commented 6 years ago

I was thinking that the different behaviors between pdfium and chromium could be chalked up to not having a build from the latest pdfium source code -- the 32bit builds at https://assendelft.webathome.org/Pdfium/ have been failing since 12/17/2017, so the most recent successful build is from 12/4/2014 (revision b8d868004).

I managed with some difficulty to get a local build working, but even with a fresh pdfium.dll I still get the same results as above -- a mostly blank page from pdfiumView+pdfium, and perfect results in chromium.

What else can I do to troubleshoot?

mrbastian commented 6 years ago

I'm closing this issue. I posted it to the pdfium project and the issue was identified and corrected https://bugs.chromium.org/p/pdfium/issues/detail?id=984

It was caused by a commit from 12/1/2017 and that commit was reverted today. If anyone is experiencing this issue you can either use a pdfium.dll built prior to 12/1/2017 or one after 1/15/2018.

bkshah4 commented 6 years ago

I am still getting blank PDFs even if i am using latest version. I have tried to switch to old stable version before 12/1/2017 but still the same. For the reference i am attaching the PDF which is causing blanks. 1.pdf