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

Border Around Printed Pages + Extra Page At End

epictions wrote on 2014-09-22:
Hi,

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:

  1. http://1drv.ms/1mpsilT
  2. http://1drv.ms/1mpsl12
  3. http://1drv.ms/1uyjv00



Let me know I can fix/troubleshoot this?

Thanks,
Ishan.
support wrote on 2014-09-23:
Hello Ishan,

Please post here your API integration code and I will look into what can be done about it.
epictions wrote on 2014-09-24:
Hi,

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->usePrintMedia(true);
	    $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);

		// Closing
		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.

Thanks,
Ishan.
support wrote on 2014-09-30:
Hello,

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

http://40p8vs17zmo4b0t673l3dl519hg.wpengine.netdna-cdn.com/wp-content/themes/lenovo-catalogue/css/print.css

If you comment out that rule, the PDF should be ok.