Issue metadata
Sign in to add a comment
|
Chromium does not implement margin-boxes (correctly)
Reported by
mart...@live.nl,
Feb 28 2017
|
||||||||||||||||||||||||
Issue descriptionChrome Version : 56.0.2924.87 URLs (if applicable) : N/A Other browsers tested: N/A Following https://www.w3.org/TR/css3-page/#margin-boxes the following margin-boxes should be implemented when converting html to pdf files: ‘@top-left-corner’ ‘@top-left’ ‘@top-center’ ‘@top-right’ ‘@top-right-corner’ ‘@right-top’ ‘@right-middle’ ‘@right-bottom’ ‘@bottom-right-corner’ ‘@bottom-right’ ‘@bottom-center’ ‘@bottom-left’ ‘@bottom-left-corner’ ‘@left-bottom’ ‘@left-middle’ ‘@left-top’ Currently, when setting the 'content' field, this is ignored when printing to pdf. What steps will reproduce the problem? 1. Create a html document with the content: <style> @page { @top-center { content: "This text should be displayed" } } </style> 2.Open in chrome 3.Press "Ctrl+P" and select "Print as PDF" What is the expected result? What happens instead? The print-preview should show the text in content. It does not Additional Info: While searching I found a bit of commented out test-code referencing these margin-boxes. Including it for completeness https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/printing/page-rule-css-text.html?q=@page&dr=C&l=86 Moved from https://bugs.chromium.org/p/pdfium/issues/detail?id=673 Please provide any additional information below. Attach a screenshot if possible.
,
Mar 1 2017
a. Is the style tag the only thing needed in the HTML file to reproduce the problem? If not, can you attach a complete example? b. Is this problem specific to "Print as PDF" or does it happen on real printers too? c. What browser implements margin-boxes correctly?
,
Mar 1 2017
a. yes. If a more real world example is requested, see this article: https://www.smashingmagazine.com/2015/01/designing-for-print-with-css/#left-and-right-page-spreads b. As I do not have a printer at hand, I am unable to test this. c. Since converting html to pdf is a feature specifically implemented by chrome (firefox, edge and IE do not have such a feature) no other browser does. On Windows an option exists to print via "Microsoft Print to PDF". This also does not implement the requested behaviour.
,
Mar 1 2017
Thank you for providing more feedback. Adding requester "thestig@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Mar 1 2017
a. Can you find or make a webpage that demonstrates the issue with margin-boxes, instead of an article that explains how to make webpages with margin-boxes?
b. That's ok.
c. Can you try {Firefox, Edge} with "Microsoft Print to PDF" and see if the produced PDF is correct?
,
Mar 2 2017
,
Mar 7 2017
I tried with IE, Firefox, and Safari, none of them seems support it. Paged media module is still a working draft, not sure whether/how long it will be adopted.
,
Mar 9 2017
,
Mar 14 2017
I could have sworn I replied to this. Here are my answers. a. The example I gave at the top of the report should be enough. c. I can confirm to @weili that it does not work I hope it gets implemented
,
Mar 27 2017
,
Jul 6 2017
More or less the same as bug 368053 and bug 320370. > What browser implements margin-boxes correctly? AFAIK none does. There are a bunch of dedicated PDF generator tools which do, though; there is a good list here: https://www.print-css.rocks/tools.html
,
Jul 11 2017
This looks like a feature request for page margin box. Let's merge into bug 320370 to have a single place for tracking. |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by dsinclair@chromium.org
, Feb 28 2017Components: Internals>Plugins>PDF Internals>Skia>PDF