New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 761672 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 724160
Owner:
Last visit > 30 days ago
Closed: Sep 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Chromium headless printToPdf partially ignores @page size, always uses US Letter dimensions

Reported by ppa.wigg...@gmail.com, Sep 3 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36

Steps to reproduce the problem:
1. Create a HTML page with @page { size: A4; }
2. Convert to PDF with headless Chromium
3. Check dimensions of PDF

What is the expected behavior?
The dimensions of the generated PDF should be A4 (210x297mm).

What went wrong?
The dimensions of the generated PDF is US Letter (8.5in x 11in).

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 60.0.3112.78  Channel: stable
OS Version: Debian Stretch
Flash Version: 

When I open the page as HTML in my Chrome browser (non-headless), press the Print icon and then choose "Save as PDF", it correctly adopts the @page size I set (in my case A4). The bug only occurs in headless mode.
 
This SO question is about this bug (check atomrc's answer and the comments on that):

https://stackoverflow.com/questions/44970113/how-can-i-change-paper-size-in-headless-chrome-print-to-pdf

This http://imgur.com/QaQQQ8R should be an A4, but it's printed as US Letter (a little wider and less high).
Cc: dvallet@chromium.org
Owner: jzfeng@chromium.org
Mergedinto: 724160
Status: Duplicate (was: Unconfirmed)
The issue looks similar to issue id: 724160. Hence, merging into issue id: 724160.
Please feel free to undupe if not the case.

Thanks...!!
Labels: Needs-Triage-M60

Sign in to add a comment