sphinx-simplepdf icon indicating copy to clipboard operation
sphinx-simplepdf copied to clipboard

Paper Size 6x9 possible?

Open mitja opened this issue 2 years ago • 1 comments

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?

mitja avatar Dec 10 '23 18:12 mitja

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;
}

danwos avatar Dec 10 '23 19:12 danwos