vilcans / screenplain

Write your screenplay in plain text and run it through this program to make it look good
MIT License
164 stars 29 forks source link

Add help text for paper size of PDF output #75

Open danielhjames opened 1 year ago

danielhjames commented 1 year ago

Useful to know if you live in a country which uses A4 paper :-)

vilcans commented 1 year ago

It's a good idea to support A4. Have you tested this so that the layout and margins are correct, and text never overflows in A4 format?

Regarding the pull request, I think changing the page size shouldn't require code changes. I'll make sure to make it configurable instead.

danielhjames commented 1 year ago

Hi @vilcans I did test it with my own screenplay of 59 pages, looks good to me in A4!

A command-line option to change paper size at runtime would be neat. I see there are a bunch of other settings in export/pdf.py but the screenplay use case is not like a general PDF renderer, where any style is desirable.

vilcans commented 1 year ago

I made a branch with support for specifying paper size, and the result is that there's a large top margin on screenplays in A4 format. Probably because the number of lines is hardcoded for the letter size. I'll look into it more.

danielhjames commented 1 year ago

Hi @vilcans in another project I have controlled the style of PDF outputs using the CSS Paged Media specification, similar to export/default.css in screenplain:

https://www.w3.org/TR/css-page-3/

This allows very precise control, but I don't see any support for this Paged Media specification in ReportLab. Also, the screenplain use case is limited to a single format and a small number of paper sizes. Therefore hard coding the parameters for each supported paper size could be the simplest solution.