New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 791173 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Not able to screenshot pdfs in Chrome

Reported by maan.ha...@gmail.com, Dec 1 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce the problem:
1. Open a pdf file in chrome
2. In dev tools:  cmd+shift+p 
3. Select mobile screenshot

What is the expected behavior?
The screenshot should appear as a normal webpage.

What went wrong?
Nothing happens

Did this work before? N/A 

Chrome version: 62.0.3202.94  Channel: stable
OS Version: OS X 10.13.1
Flash Version: 

The headless mode hangs on pdf load.
 
Components: Internals>Headless
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome  --headless --disable-gpu --screenshot <PATH_TO_PDF> hangs
The pdf viewer probably has not been implemented in headless mode yet.

Why do you want to take a screenshot of a pdf? 

Comment 4 by rvera@chromium.org, Dec 4 2017

Status: Available (was: Unconfirmed)
Taking screenshots of pdf helps with testing pdf generation at scale. A user can be presented with a pdf(eg: certificate of course completion) and the user can click the certificate to view it in Chrome without going to PDF tools on the system. Having headless chrome take screenshots of specific pdf pages would help accomplish this and take care of any regressions that might arise out of pdf generation code. Of course some bits can be handled offline by using other pdf utilities but using Chrome ensure that we test the exact thing that the user would see. This would also avoid any need for special handling of pdf urls in headless chrome.
Non-headless chrome implement the pdf viewer as a chrome extension [1]. In headless chrome, we don't support extension, which requires too much work. This means adding pdf viewer to headless chrome is impossible for now.

I would suggest convert the pdf files into images in the automation test instead.

[1] //src/chrome/browser/resources/pdf
Cc: jzfeng@chromium.org
Status: WontFix (was: Available)
This is not feasible, closing.

Sign in to add a comment