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

Paper Size 6x9 possible? #96

Open
mitja opened this issue Dec 10, 2023 · 1 comment
Open

Paper Size 6x9 possible? #96

mitja opened this issue Dec 10, 2023 · 1 comment

Comments

@mitja
Copy link

mitja commented Dec 10, 2023

I would like to generate a PDF file for a self-published book. A common format is 6 inches by 9 inches. Is it possible to customise the paper size with sphinx-simplepdf?

@danwos
Copy link
Member

danwos commented Dec 10, 2023

Haven't tested it, but as the PDF generation is based in weasyprint, which config is mostly done in CSS and which Sphinx-SimplePDF allows to manipulate, I would say yes :)

Just follow the docs from weasyrpint for page size and introduce the changes to Sphinx by using html_css_file in your conf.py. That should do the trick, maybe add an !important after your custom CSS attribute to overwrite the config from Sphinx-SimplePDF.

Needed CSS:

@page {
  size: 6in 9in;
}

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