WebAPI/WebPrintAPI: Difference between revisions

Jump to navigation Jump to search
Add open question about onBefore/AfterPrint
(Add onBeforePrint and onAfterPrint)
(Add open question about onBefore/AfterPrint)
Line 7: Line 7:
Defining the PrintSetting API as used in PrintDocument.print(printSetting) is out of the scope of this document.
Defining the PrintSetting API as used in PrintDocument.print(printSetting) is out of the scope of this document.


<h2> Notes </h2>
== Notes ==
<ul><li> Use points as metric for printing (72 points per inch)
* Use points as metric for printing (72 points per inch)
</li><li> Use of "px" doesn't make sense. Therefore they are forbidden (e.g. in font-size="12px") - use "pt" instead.
* Use of "px" doesn't make sense. Therefore they are forbidden (e.g. in font-size="12px") - use "pt" instead.
</li><li> Use of ctx.putImageData(...) and ctx.getImageData(...) doesn't make sense as there might not be something like "pixels" on the printer backend.
* Use of ctx.putImageData(...) and ctx.getImageData(...) doesn't make sense as there might not be something like "pixels" on the printer backend.
</li><li> Open Questions
* If the user selects File -> Print from the menu, the developer can
<ul><li> What is (0,0)? The top left corner of the physical page OR of the page taking into account the print margin?
* Open Questions
</li><li> Should there be different color spaces then RGB? There is a <a href="http://www.w3.org/TR/css3-gcpm/#cmyk-colors">proposal for CMYK colors in CSS</a>.
** What is (0,0)? The top left corner of the physical page OR of the page taking into account the print margin?
</li><li> Should the browser display a progress view while the pages are drawn (this doesn't mean the actual printing output progress)?
** Should there be different color spaces then RGB? There is a <a href="http://www.w3.org/TR/css3-gcpm/#cmyk-colors">proposal for CMYK colors in CSS</a>.
</li><li> Lot more... TBD
** Should the browser display a progress view while the pages are drawn (this doesn't mean the actual printing output progress)?
</li></ul>
** Should there be additional onBeforePrint/onAfterPrint callbacks on the PrintDocument object, or are the window.onBeforePrint/onAfterPrint events enough?
</li></ul>
** Lot more... TBD
<h3> Possible values for the 'scale' property (see below) </h3>
 
<ul><li> 'scale': Scales the drawing while keeping the ration to to fit on the print paper size
=== Possible values for the 'scale' property (see below) ===
</li><li> 'fit': Scales the drawing while not taking the ration of the printer paper size in account
* 'scale': Scales the drawing while keeping the ration to to fit on the print paper size
</li><li> 'center': No scaling, just placing the center of the drawing onto the center of the printer paper.
* 'fit': Scales the drawing while not taking the ration of the printer paper size in account
</li></ul>
* 'center': No scaling, just placing the center of the drawing onto the center of the printer paper.


== Example ==
== Example ==
49

edits

Navigation menu