Export PDF from Zoho Books via API

Export PDF from Zoho Books via API

Hi,

I'm trying to export a PDF of all the invoices from a customer in Zoho Books via API.
I'm doing it this way:

$url = ' https://books.zoho.com/api/v3/invoices/pdf?';
$token = "xxxxxxxxxxxxxxxxxxxxx";
$org_ID = "xxxxxxxx";
$invoice_ids = "6289710000XXXXXXXX,62897100000YYYYYYY";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . 'authtoken=' . $token . '&organization_id=' . $org_ID . '&invoice_ids=' . $invoice_ids);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json"));
$contact = curl_exec($ch);

It seems to work fine but it doesn't generate any PDF file. If I print $contact i can see all the PDF codification (%PDF-1.4 %���� 1 0 ......), but there isn't a PDF file that I can save.

How could I get that PDF file?

Thanks!