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

Increase page margins #359

Closed
DanielSWolf opened this issue Dec 1, 2020 · 2 comments · Fixed by #361
Closed

Increase page margins #359

DanielSWolf opened this issue Dec 1, 2020 · 2 comments · Fixed by #361

Comments

@DanielSWolf
Copy link

When I create a PDF file using Asciidoctor Web PDF, it has nice side margins (the borders on the left and right side). The top and bottom margins, however, are very slim, almost non-existent.

To reproduce:

  1. Take this minimal AsciiDoc file

  2. Call asciidoctor-web-pdf --out-file lorem.pdf lorem.adoc

  3. This is the resulting PDF file. Note that on the very first page, the top margin still looks good. On the following pages, however, both top and bottom margin are only a few millimetres wide.

Is it possible to increase these margins?

More generally, is there a way to specify the page margins when calling asciidoctor-web-pdf?

@ggrossetie
Copy link
Owner

Hey @DanielSWolf

Yes, you can configure margin using CSS:

@page {
  margin: 3cm 2cm 3cm 2cm;
}

Please read the "Custom styles" section to find out how to provide a custom stylesheet: https://github.com/Mogztter/asciidoctor-web-pdf#configuration

However, the top margin is indeed very slim:

Asciidoctor PDF Asciidoctor Web PDF
asciidoctor-pdf-top-margin asciidoctor-web-pdf-top-margin
asciidoctor-pdf-top-margin-first-page asciidoctor-web-pdf-top-margin-first-page

I'm willing to update the default style to increase the margin a bit to match Asciidoctor PDF current output.

@DanielSWolf
Copy link
Author

I just tried version 1.0.0-alpha.11. The new default margins look much better to me. Thank you!

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

Successfully merging a pull request may close this issue.

2 participants