This is an archived forum post. The information may be outdated. Contact us if you have any questions.

php web page with charts ( donut, morris etc), convert to pdf shows small size and stick to left side contents

sunnysehgalji wrote on 2018-03-19:
when i am using pdfcrowd api code below :-

require 'pdfcrowd-php/pdfcrowd.php';

// create an API client instance
$client = new Pdfcrowd("username", " api key ");
$client->setPageMargins("20mm", "20mm", "20mm", "20mm"); // <<< this is my addition line

$pdf = $client->convertURI('');
// set HTTP response headers
header("Content-Type: application/pdf");
header("Cache-Control: max-age=0");
header("Accept-Ranges: none");
header("Content-Disposition: attachment; filename=\"Analytics.pdf\"");

// send the generated PDF
echo $pdf;

catch(PdfcrowdException $why)
echo "Pdfcrowd Error: " . $why;

NOTE:- what happened that my php web page containing some charts ( donut , morris etc ), when page converted to pdf file, the text of the page is small and lean to left hand side, i m also attached my pdf file
support wrote on 2018-03-19:

Our Stable API has some issues with charts.

Could you please try the new version of our API to see if it resolves your issue?
The new version is currently in beta and it is free to use.

You can activate access to the new API here:

You need to install the latest PHP client library:

Update your code according to the new documentation because new API has somewhat different syntax: