it is (currently) neither possible through App Script API ...nor the Macro Recorder
therefore, I'd suggest to utilize some Chrome extension, alike Automation.
the key-codes to open the page setup dialog and enter the desired values and then proceed to hit the Next
button, should be about alike this: <Alt> + F
, P
, (select margins, then select custom numbers, then select the top margin entry field, that can be reached by <Tab>
, <Cursor Down>
and <Space>
)... and then 0.25"
, <Tab>
, 0.25"
, <Tab>
, 0.25"
, <Tab>
, 0.25"
... <Tab>
, <Tab>
, <Enter>
.
from within a spreadsheet (and not even from within client-side JavaScript), without any browser extension, which can send key-codes, there is no access to these properties - because otherwise scripts could easily mess up custom local printer settings.