This is an archived forum post. The information may be outdated. Contact us if you have any
Border Around Printed Pages + Extra Page At End
wrote on 2014-09-22:
I am trying to take printouts via API but all prints have a strange light grey border around them.
Second issue is that there's an extra page at end of my printouts. Both of these happen only via API. If I take printout using the browser, the issues go away!
I am attaching prints I got from API for this page: http://lenovocatalogue.com/product/thinkpad-x1-carbon-2/ If you go and print via Chrome, the issues won't be there.
Here are links to the PDFs. First two are from PDF crowd API, last is using Chrome:
Let me know I can fix/troubleshoot this?
wrote on 2014-09-23:
Please post here your API integration code and I will look into what can be done about it.
wrote on 2014-09-24:
It is standard code that you have in documentation here: https://pdfcrowd.com/api/html-to-pdf-php/#getting-started
The code that I am actually using is:
$client = new Pdfcrowd("***", "***");
// $pdf = '';
// convert the print product page and store the generated PDF into a $pdf variable
$client->setPageWidth( '8.3in' );
$client->setPageHeight( '11.7in' );
$client->setPageMargins( '0.25in', '0.25in', '0.25in', '0.25in' );
$pdf = $client->convertURI($product_url);
// $pdf = $client->converHtml('<html><body>This is test HTML</html</body>');
// Create a new file to write into.
$disk_file_handle = fopen($lenovo_pdf_complete_path, 'w');
// Write the file and save status to check.
$write_status = fwrite($disk_file_handle, $pdf);
fclose( $disk_file_handle );
Also, the border is not an issue. It does not show up in most PDF readers. Just that, extra line of text is there at the end of the document, which creates an entirely new page.
wrote on 2014-09-30:
Sorry for the late reply, but it took us some time to find out the cause. It seems that the extra page is caused by the "page-break-after:always" rule defined on line 310 in