Turn on landscape with PDF template

I’m trying to use the pdf template system to create a pdf from json, but I can’t seem to get it in landscape mode.

As the json is loaded with the pdf object when constructed, I can’t seem to update the page size or turn landscape on after either, as this means all the page items aren’t in their correct places.

I’m using version 2023 r3
Can someone please give me a point in the right direction? Thanks