/chrome/community?hl=en
This content is likely not relevant anymore. Try searching or browse recent questions.
-
9/10/19
PDF documents not viewed in 100% of browser height 0 Recommended Answers 6 Replies 26 Upvotes
1 Recommended Answer
$0 Recommended Answers
We have started getting reports today that users is not showed the full PDF file in Chrome.
This happens to some of our uses but not all of them.

We who get the problem is viewing the PDF file in a view of150px of height (But our browser window is more then 1000px).
It seems like the internal CSS rule in Google Chrome is ignored.

The version Im running is: Version 76.0.3809.132 (Officiell version) (64 bitar) on Windows 10.

Not all people with the same version of chrome and Windows is getting this error.

Screenshot 1 (showing problem in Google Chrome 76):


Screenshot 2 (showing working in Google Chrome 76):
All Replies (6)
9/10/19
I am experiencing this issue as well. What's strange is that the PDFs are full height on my test server but not in production. The code is exactly the same on both servers.
marked this as an answer
Helpful?
9/11/19
We have run into this also. While it works on my machine OSX 10.14.6, chrome:  76.0.3809.132 (Official Build) (64-bit). There are other OSX computers where it is not working.  Disabling extensions doesn't help.
marked this as an answer
Helpful?
-
9/11/19
we seem to get CSP errors (In Console window) when this happens, is it the same for you?
marked this as an answer
Helpful?
9/11/19
I do think it is a CSP issue. I just realized why it works on my test server but not production. On the test server I do not have CSP enabled. Apparently Chrome is using inline CSS to style the PDF.

I have created a workaround where if the user is using Chrome, instead of linking directly to the PDF file, I link to a page where the PDF is embedded as an <object>, and then I use jQuery to style the object.

$(function() {
    
    //style our html, body, and object elements
    $("html").css("height", "100%");
    $("body").css({"height": "100%", "margin": "0", "overflow": "hidden"});
    $("object").css({"height": "100%", "width": "100%"});
    
    //check if the pdf has loaded yet
    checkPdf();

});

function checkPdf() {
    var checkPdf = setInterval(function() {
        if ($("object").length) {
            var body = $($($("object")[0].contentDocument).children("html")[0]).children("body");
            if (body.length) {
                if (body[0].children.length) {
                    
                    //the pdf has loaded, now style it!
                    stylePdf();
                    
                    clearInterval(checkPdf);
                }
            }
        }
    }, 1);
}

function stylePdf() {
    var html = $($("object")[0].contentDocument).children("html")[0];
    $(html).css({"height": "100%", "overflow": "hidden"});
    $($(html).children("body")[0]).css({"height": "100%", "margin": "0"});
}
Last edited 9/11/19
marked this as an answer
Helpful?
9/11/19
We have recently added csp protections, but I get the CSP errors on machines where it works and where it doesn't work. So I didn't think it was related.
marked this as an answer
Helpful?
2 days
Same problem running Chrome Version 77.0.3865.90 (Official Build) (64-bit) in Ubuntu 18.04.3 LTS. I have to either manually download PDFs or change this setting: https://support.google.com/chrome/answer/6213030
marked this as an answer
Helpful?
This reply is no longer available.
This question is locked and replying has been disabled.
Discard post? You will lose what you have written so far.
Write a reply
10 characters required
Failed to attach file, click here to try again.
Discard post?
You will lose what you have written so far.
Personal information found

We found the following personal information in your message:

This information will be visible to anyone who visits or subscribes to notifications for this post. Are you sure you want to continue?

A problem occurred. Please try again.
Create Reply
Edit Reply
Delete post?
This will remove the reply from the Answers section.
Notifications are off
Your notifications are currently off and you won't receive subscription updates. To turn them on, go to Notifications preferences on your Profile page.
Report abuse
Google takes abuse of its services very seriously. We're committed to dealing with such abuse according to the laws in your country of residence. When you submit a report, we'll investigate it and take the appropriate action. We'll get back to you only if we require additional details or have more information to share.

Go to the Legal Help page to request content changes for legal reasons.

Reported post for abuse
Unable to send report.
This reply is no longer available.
/chrome/threads
//accounts.google.com/ServiceLogin
You'll receive email notifications for new posts at
Unable to delete question.
Unable to update vote.
Unable to update subscription.
You have been unsubscribed
Deleted
Unable to delete reply.
Removed from Answers
Marked as Recommended Answer
Removed recommendation
Undo
Unable to update reply.
Unable to update vote.
Thank you. Your response was recorded.
Unable to undo vote.
Thank you. This reply will now display in the answers section.
Link copied
Locked
Unlocked
Unable to lock
Unable to unlock
Pinned
Unpinned
Unable to pin
Unable to unpin
Marked
Unmarked
Unable to mark
Reported as off topic
/chrome/profile/0?hl=en