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