Closed
Bug 1247422
Opened 7 years ago
Closed 6 years ago
Expose printing resolution and scaling via CanvasPrintState
Categories
(Core :: Printing: Output, defect)
Core
Printing: Output
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: tschneider, Assigned: tschneider)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
3.43 KB,
patch
|
Details | Diff | Splinter Review | |
7.76 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
In order to render pages in PDF.js that mach the printers DPI when printing, the CanvasPrintState, passed to mozPrintCallback handlers, should contain a printerPixelRatio property so that drawing commands to the printing context can be scaled appropriately.
Assignee | ||
Comment 1•7 years ago
|
||
Part 1: Expose printingPixelRatio in CanvasPrintState
Assignee | ||
Updated•7 years ago
|
Attachment #8718087 -
Attachment description: bug1247422.diff → Part 1: Expose printingPixelRatio in CanvasPrintState
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → tschneider
Assignee | ||
Comment 2•7 years ago
|
||
Comment on attachment 8718087 [details] [diff] [review] Part 1: Expose printingPixelRatio in CanvasPrintState Robert, asking you to review this since you also reviewed the original patch that introduced the mozPrintCallback event.
Attachment #8718087 -
Flags: review?(roc)
Depends on: 1249214
Assignee | ||
Comment 3•7 years ago
|
||
Added ref test. To make this a reliable test I had to change the print preview scaling to something different than the page scaling in nsDocumentViewer.cpp. This doesn't seem to affect other tests, except of the original mozPrintCallBack reftest, which gets updated by this patch as well.
Attachment #8718087 -
Flags: review?(roc)
Assignee | ||
Updated•7 years ago
|
Attachment #8718087 -
Flags: review?(mstange)
Assignee | ||
Updated•7 years ago
|
Summary: Expose printer DPI via CanvasPrintState → Expose printing resolution and scaling via CanvasPrintState
Assignee | ||
Comment 4•7 years ago
|
||
Update patch to also expose the scaling applied on the canvas for printing
Attachment #8718087 -
Attachment is obsolete: true
Attachment #8718087 -
Flags: review?(mstange)
Attachment #8736596 -
Flags: review?(mstange)
Comment 5•7 years ago
|
||
Comment on attachment 8736596 [details] [diff] [review] Part 1 (v2): Expose printingPixelRatio in CanvasPrintState Review of attachment 8736596 [details] [diff] [review]: ----------------------------------------------------------------- This seems fine because it's needed when web content creates its own intermediate surfaces. ::: layout/base/nsDocumentViewer.cpp @@ +842,4 @@ > mPresContext->CSSTwipsToAppUnits(NSToIntFloor(pageHeight)))); > mPresContext->SetIsRootPaginatedDocument(true); > mPresContext->SetPageScale(1.0f); > + mPresContext->SetPrintPreviewScale(1.5f); Does this have an effect on anything other than the new printing reftest you're adding?
Attachment #8736596 -
Flags: review?(mstange) → review+
Assignee | ||
Comment 6•7 years ago
|
||
>> Does this have an effect on anything other than the new printing reftest you're adding?
No.
Comment 7•7 years ago
|
||
Ok. Please add a comment to that line, explaining why you chose 1.5, what it's used for, and why it doesn't affect anything else, and also add a comment to the reftest pointing to this function so that readers know where the number is coming from.
Comment 8•7 years ago
|
||
I don't see you declare 'scale' in PrePrintNextPage. Doesn't compiler complain it? @@ -681,7 +681,7 @@ nsSimplePageSequenceFrame::PrePrintNextPage(nsITimerCallback* aCallback, bool* a // Start the rendering process. nsWeakFrame weakFrame = this; - canvas->DispatchPrintCallback(aCallback); + canvas->DispatchPrintCallback(aCallback, scale); NS_ENSURE_STATE(weakFrame.IsAlive());
Flags: needinfo?(tschneider)
Assignee | ||
Comment 9•6 years ago
|
||
Won't fix since we will focus on other efforts to optimize quality of printing PDF's (see bug 1269760).
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(tschneider)
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•