Bug 262156
| Summary: | PDF.js UI is printed when printing a PDF document | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> |
| Component: | Assignee: | Nobody <webkit-unassigned> | |
| Status: | NEW | ||
| Severity: | Normal | CC: | bugs-noreply, mcatanzaro, ntim, thorton, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | PC | ||
| OS: | Linux | ||
Michael Catanzaro
When printing a PDF document, WebKit should integrate with PDF.js's print functionality and not print the PDF.js UI itself.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Michael Catanzaro
(In reply to Michael Catanzaro from comment #0)
> When printing a PDF document
Specifically, the problem occurs when printing the document using the browser's print UI rather than PDF.js's print UI. Presumably it wouldn't happen if using the print button in PDF.js itself. That button is actually broken, but it looks like bug #260771, so I'll expand the scope of that bug instead of reporting a new one.
Radar WebKit Bug Importer
<rdar://problem/116435714>
Tim Nguyen (:ntim)
I would suggest as a starter to use `@media (print)` in the custom stylesheets to make printing behave as expected + somehow force the print button to load all the PDF pages.
Alternatively, there might be a better way if you somehow use messaging + PDF.JS APIs to print.
Michael Catanzaro
(In reply to Tim Nguyen (:ntim) from comment #3)
> Alternatively, there might be a better way if you somehow use messaging +
> PDF.JS APIs to print.
This will be a better (and probably easier) solution. Basically we should forward WebKit's print command to PDF.js, which knows how to prepare the document properly.
Tim Nguyen (:ntim)
(In reply to Michael Catanzaro from comment #4)
> (In reply to Tim Nguyen (:ntim) from comment #3)
> > Alternatively, there might be a better way if you somehow use messaging +
> > PDF.JS APIs to print.
>
> This will be a better (and probably easier) solution. Basically we should
> forward WebKit's print command to PDF.js, which knows how to prepare the
> document properly.
You can look at how the custom context menu commands are handled for messaging to PDF.JS.