Hello,
You can change the PDF page orientation with the setPageWidth and setPageHeight API functions. A PHP example:
// A4 landscape
$client->setPageWidth("298mm");
$client->setPageHeight("210mm");
// A4 portrait
$client->setPageWidth("210mm");
$client->setPageHeight("298mm");