At least I found out the following.
PHPRunner generates a json file for each page in a folder pdf.
Open that and add at the end something like
// a string or { width: number, height: number }
pageSize: 'A4',
// by default we use portrait, you can change it to landscape if you wish
pageOrientation: 'portrait',
// [left, top, right, bottom] or [horizontal, vertical] or just a number for equal margins
pageMargins: [ 56, 155, 56, 20 ],
and you can change pageSize and pageMargins.
So, is there a way to change these settings programatically?
But this is only something for the very late deployment, since the json files are overwritten with any change in Designer.