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

The generated PDF makes an extra empty page

sylouuu wrote on 2014-04-07:
Hi,

Thank's for this service.

I want to generate a PDF in landscape orientation. I made < section > in my HTML as a "page" with specific dimensions 1280*890px.

I can have multiple pages.

I want an A4 output format to print, then I configured PDFCrowd:

try {
    // create an API client instance
    $client = new Pdfcrowd('...', '...');

    // convert a web page and store the generated PDF into a $pdf variable
    $client->setPageWidth('297mm');
    $client->setPageHeight('210mm');

    $pdf = $client->convertURI('http//domain.com');

    // set HTTP response headers
    header('Content-Type: application/pdf');
    header('Cache-Control: no-cache');
    header('Accept-Ranges: none');
    header('Content-Disposition: attachment; filename=\'file.pdf\'');

    // send the generated PDF
    $response = $pdf;
} catch(PdfcrowdException $why) {
    $response =  'Pdfcrowd Error: ' . $why;
}

return $response;


I didn't find why I have an extra empty page in my PDF. I'd like to know what should I do to resolve that.

Bests!

EDIT: Fixed, got an extra margin in the footer.
support wrote on 2014-04-08:
Hello,

Good to hear that you worked it out. An extra bottom margin and a non-zero body margin are the most often causes.