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

Header showing smaller

gbweb wrote on 2012-04-06:
This script pulls the same exact URL, I just have the height sized down so that it will only show the header. Any reason as to why the header would show at a different size?


http://pp.gbdev1.com/PDF.php?filename=Chambers+USA+2009+Recognizes+Parker+Poe+Among+America%27s+Leading+Law+Firms
support wrote on 2012-04-06:
The URL you posted does not work for me, it returns
Notice: Undefined index: HTTP_REFERER in /gbdev/pnc_pp/htdocs/PDF.php on line 2
gbweb wrote on 2012-04-06:
http://pp.gbdev1.com/news/ichambers-usai-2009-recognizes-parker-poe-among-americas-leading-law-firms/

Click the PDF Icon there to access the URL
gbweb wrote on 2012-04-06:
Also sometimes it generates a PDF, sometimes we get this error:


Fatal error: Uncaught exception 'PdfcrowdException' with message 'Can't load the specified URL.' in /gbdev/pnc_pp/htdocs/pdfcrowd.php:335 Stack trace: #0 /gbdev/pnc_pp/htdocs/pdfcrowd.php(103): PdfCrowd->http_post('http://pdfcrowd...', 'username=gbweb&...', NULL) #1 /gbdev/pnc_pp/htdocs/PDF.php(24): PdfCrowd->convertURI('http://pp.gbdev...') #2 {main} thrown in /gbdev/pnc_pp/htdocs/pdfcrowd.php on line 335
support wrote on 2012-04-08:
Ok, please could you post here your API integration code you use for this page?
gbweb wrote on 2012-04-09:
require_once('pdfcrowd.php');
$filename = urldecode($_GET['filename']);
$client = new Pdfcrowd("xxx", "xxxxx");
$client->usePrintMedia(True);
$client->setHorizontalMargin('.75in');
$client->setVerticalMargin('.75in');
$client->setInitialPdfZoomType(3);
$client->setHeaderUrl("$url&PDF=header");
$client->setFooterHtml("<p align='right'>%p of %n</p>");
$pdf = $client->convertURI("$url&PDF");

@header("Content-Type: application/pdf");
@header("Cache-Control: no-cache");
@header("Accept-Ranges: none");
@header("Content-Disposition: attachment; filename=\"".$filename.".pdf\"");

echo $pdf;
support wrote on 2012-04-09:
The header page contains div#siteCenter whose width is set to 926px which is 9.56'

The width of the PDF printable area is 8.3' - 2*0.75 = 6.8' so the header page is scaled down to ~71% to fit the PDF page. That's why the header comes out smaller.

To fix this, you need to make the header page width smaller or equal than the PDF printable area width. Even better would be to use an HTML fragment containing only the header code instead of the whole web page.

Regarding the timeout error, we will take a closer look at it and update you once we know the cause.