Option to specify page size for PDF export

I would like to add an option to the Settings screen to specify the page size for the PDF export.

Currently it is coded to use the default, which is A4. This is rather annoying for people who live in North America and a few other countries, because every time one exports a note to PDF, the result is a PDF with page size A4.

I’d add the Letter and A4 page sizes. I’m not sure if there should be other formats added as well.
A4 would still be the default.

I think that if you’re going to give the paper size option, then a landscape option would be good too. It comes in handy for printing tables.

@laurent what’s your take on this? I find it truly annoying that export to PDF uses A4.

I’m not keen to add an option for this. The way I see it should be done in a standard way - when we export, we show a dialog to set various settings like page format, margins and so on. Maybe there’s an Electron lib to do this, or if not we’ll need to create our own dialog. We can remember at that point what settings the user chose.

Hmm, to be honest that would be even more annoying. When you are living in a certain part of the world, you are used to a certain paper format. Setting the margins is a nice thing, but this is not a desktop publishing software. (This could be a nice feature for printing, but absolutely unnecessary for exporting to PDF.) I want to export my notes to a format I’m used to. I certainly do not want a dialog box to pop up every time I export a note. The only thing that is really important for exporting to PDF is the target paper size. And you won’t change that one - ever. Unless you move to a different part of the world where a different paper size is used.

If you do not want it to make am official setting, how about an unofficial one? In that case I can set a flag in the db and I get my Letter format.

@laurent I have created a branch that adds an unofficial setting. Now one can add the key export.pdfPageSize with the value Letter to the database (settings table) and the export to PDF is done to Letter format.
If someone adds garbage to the database, it will fall back to A4, so no errors will occur in Joplin.
It doesn’t change the default behavior of Joplin, nor are there any changes to the settings page.
I did not create a PR, because I wanted to show you what I meant in my previous post first.