Not able to screenshot pdfs in Chrome
Reported by
maan.ha...@gmail.com,
Dec 1 2017
|
||||
Issue descriptionUserAgent: 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.
,
Dec 2 2017
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --disable-gpu --screenshot <PATH_TO_PDF> hangs
,
Dec 4 2017
The pdf viewer probably has not been implemented in headless mode yet. Why do you want to take a screenshot of a pdf?
,
Dec 4 2017
,
Dec 5 2017
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.
,
Dec 6 2017
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
,
Dec 6 2017
,
Dec 11 2017
This is not feasible, closing. |
||||
►
Sign in to add a comment |
||||
Comment 1 by manoranj...@chromium.org
, Dec 2 2017