New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blank PDF pages #88
Comments
We have the same issue, but it appears only on large pdf files. |
Same here - I can open a file of about 150kb but anything bigger than about 500kb and it doesn't want to know. |
Well I am glad I'm not alone! So I am able to load larger PDF's without issue on my desktop. I have one that is 1,461kb that loads on my desktop in Chrome without issue and loads on an ipad without issue as well. My Adobe LiveCycle generated pdfs are 159 - 377kb and load on my desktop but not on the iPad. Larger PDF's generated without Adobe LiveCycle, load on both the desktop and on the iPad. These larger documents do take a bit longer to load, but eventually show as readable pages within the iframe. Is anyone else running into load issues on just the iPad? |
I'm not sure if this was created with LiveCycle or not. I got sent this PDF that I would like to put on our website. It's 800kb which I wouldn't describe as massive, but just cannot get it to display. I've tried another PDF which is only 100kb and it worked fine. |
Interesting... Do these files contain forms/input fields? Relevant links: LiveCycle does appear to generate PDFs that don't work with many free viewers. |
Mine doesn't contain forms or fields. Here is mine: http://www.brookvalehighschool.co.uk/pages/home/documents/Brookvale%20Prospectus.pdf |
Mine do not have inputs of any type for the user to interact with, they are On Mon, Sep 8, 2014 at 10:42 AM, simonhayes81 notifications@github.com
Joe Mester |
Hello @adityab, I can't share my PDF's due to privacy issues, but I can do my best to give you all the information you might need. I'm going to be looking into this project for the next hour or two and would appreciate any input you have. |
So no solution yet, but hopefully some info and questions to help find one. Info: PDF Version is 1.2 (Acrobat 3.x) Questions: @adityab what other information is going to be useful to understanding and testing this PDF? Is it possible information is missing in the header for the document that is needed? |
If you click on presentation then the page that you are currently on does show, but if you scroll either way the rest of them are blank. |
Just to confirm that I too am seeing the issue, in two different guises. Some docs I am getting blank pages (eg. 12 page pdf shows as 12 blank pages) and other times I am getting only the outer ViewerJS display with a gray background and nothing else. |
In my case I am getting one of @haydeny 's experiences, "I am getting blank pages (eg. 12 page pdf shows as 12 blank pages) " It seems that viewer.js is getting part of the way there, but not all the way. Perhaps this is a memory or cache related issue since we are getting part of the PDF's information but not all of it? |
Thanks for pointing that out. It looks like a race condition related to the promise-heavy PDFjs code, that is not properly handled in ViewerJS. If an urgent, fast-track fix is needed, please send a support email to viewerjs-support@kogmbh.com (The LiveCycle thing is another issue but I suppose we cannot really do anything about that). |
I'm glad we were able to locate a reason, I am betting the race condition will resolve the LiveCycle issue. If you wouldn't mind pointing me towards a file or line for that race condition I'll take a stab a cleaning up this TODO. I'd really like to get this working for the project I am working on. Thanks again for your help! |
I've done a bit more digging today and am scratching my head still. I dug around for race conditions in the PDFjs code and found that their aren't many of them to review. I spent a bit of time messing with LabCSClosure and with function fn_g(x) { but wasn't making much progress. I did some more digging into my PDF's color space and found that my PDF's have a DeviceGray colorspace and I am curious to know if anyone else has PDF's with this color space. Thanks again for the awesome work you've done so far and taking the time to respond to my posts. |
Hello do you have any news about this bug? |
I have something what can be helpful. With current code it can happen quite often, because of race between rendered pages, each page is rendered asynchronously. And because of some reasons when the order is mixed finishing code is not called this one exacly. Except this behaviour mixed page rander is bad, because after each page render it is added to DOM here. So when it will be added in wrong order the pages will be displayed in wrong order, I suppose (Right now instead of that we got blank pages). I have implemented a simple fix which render pages one by one instead of all at the same time. And I have tested that for big pdf and it works perfectly. But I'm not sure if it is the best solution, I haven't read any documentation or tips how it should be done. Just fixed the problem I noticed. // ------ MODIFIED PART ------
var pageIterator = 0;
function createNextPage() {
if (pageIterator < pdfDocument.numPages) {
pdfDocument.getPage(pageIterator + 1).then(function (page) {
createPage(page);
pageIterator++;
createNextPage();
});
}
}
createNextPage();
// ------ END MODIFIED PART ------
// ------ ORIGINAL PART ------
//for (i = 0; i < pdfDocument.numPages; i += 1) {
// pdfDocument.getPage(i + 1).then(createPage);
//}
// ------ END ORIGINAL PART ------ Of course it works slower but it works. |
@akszydelko - your fix works. Thank you for sharing |
While I could not reproduce the problem even with the provided PDF the problem @akszydelko found and has described I also see in theory. |
I’m still having problems. It seems to work fine in Google Chrome, but in Internet Explorer the PDF takes ages to load and when it does the text is all garbled. |
@simonhayes81 Which version is your Internet Explorer? For what I tested with latest IE10 it seems fine. |
IE11 I've put it up here: http://www.brookvalehighschool.co.uk/pages/home/prospectus.html |
Ah, that pdf, even part of my testing set :) Hm, that page works fine in IE10 for me (besides taking some time without any feedback/loading screen, but that is a different issue, tracked in #96). No IE11 available right now, anyone else could confirm? So far hoping it is a caching issue perhaps? :) |
On further examination, it seems to work fine on Windows 10 in IE 11, but not in Windows 7. |
Could you post a screenshot to get a better idea what "text is all garbled." means? |
Just done some more testing, and in actual fact it does load properly on Windows 7 with IE11, but takes a very very long time to load (around 2 minutes), an unacceptable amount of time in fact because almost everyone would have given up by then. Windows 8 IE11 takes too long to load and also has the garbled text problem which I will post in a minute. Windows 10 IE11 which I'm running on Hyper-V works fine, loads pretty much instantly and the text is as it should be. |
http://www.brookvalehighschool.co.uk/pages/home/garbled.png That's the shot where the text is garbled. I suppose you could argue that people shouldn't be using IE and definitely shouldn't be using Windows 8, but would rather find a solution! |
Thanks, I see. Not using IE would indeed be a solution :) but right, reality is what we are here for. Very possibly some issue in pdf.js then. Nothing I can help with just a few finger snips. No (free) time to look deeper into that myself, sorry. So it's either hoping someone else has energy and resources to dive into that and see what needs fixing and then fix it. Or you investing into someone doing that (where I of course recommend contacting viewerjs-support@kogmbh.com but then working patches will be accepted for ViewerJS/pdf.js independent of who created them :) ). |
Any ideas why it would do this on Windows 8, but not Windows 7 or Windows 10? |
I also have a large pdf the loads super slowly and ends up with blank pages. I don't see a file called PDFViewerPlugin.js when I download the zip file from viewerjs.org. Should I be downloading it directly from Github? |
Getting complaints from IE 11 users myself, had a staff member test and they can reproduce. Edge works fine. Any motion on this? |
Hello All,
First off thank you for this tool, it is awesome and I've enjoyed learning about it! I've hit a bit of a issue I'm hoping someone might be able to help me with. I am embedding PDF documents which have been created via Adobe LiveCycle and have run into an issue where the documents pages are loaded but appear blank. If I click on the download button the document loads up without issue and I can scroll without issue. Does anyone have a thought on why I am not able to see document text within the iframe?
All other PDF's seem to work fine, its just Adobe LiveCycle ones that seem to be causing an issue.
Any help you can offer would be great.
The text was updated successfully, but these errors were encountered: