and you can use "transposed" for more elegantly :)* In PDFFormat>>setPortrait and >>setLandscape maybe #defaultSize should be used instead of #size to get size, because otherwise, two consecutive #setLandscape result in a portrait size.
setPortrait
"Set the page in portrait orientation"
self portrait: true.
self size: (self defaultSize x) @ (self defaultSize y).
setLandscape
"Set the page in landscape orientation"
self portrait: false.self size: self defaultSize transposed
Regards.