Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make pdf pages in horizontal orientation? #184

Open
Beathoven1 opened this issue Aug 14, 2020 · 1 comment
Open

How to make pdf pages in horizontal orientation? #184

Beathoven1 opened this issue Aug 14, 2020 · 1 comment

Comments

@Beathoven1
Copy link

I am writing in html and ran into a problem. I want pages in landscape orientation, and they are displayed in vertical orientation. How and in which file can the orientation of the resulting pdf be edited?

@Zulko
Copy link
Member

Zulko commented Aug 19, 2020

You can set the document dimensions in the CSS with the @page syntax, except -page-width and -page-height had to be replaced by -relaxed-page-width -relaxed-page-height, unfortunately, due to a limitation of the Pupetteer API.

See this ReLaXed example for horizontal (poster) dimensions:

https://github.com/RelaxedJS/ReLaXed-examples/tree/master/examples/poster

Here is the relevant bit from the SCSS file:

$page_width: 46.8in;
$page_height: 33.1in;
$margin: 1.2in;

@page {
  size: $page_width $page_height;
  -relaxed-page-width: $page_width;
  -relaxed-page-height: $page_height;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants