Hi,
I am making a fairly complex PDF with a custom font. It works perfectly on my dev machine, however on the live server any PDF generated when opened in Adobe Acrobat isn't rendered and the error message appears as "There was an error processing a page. There was a problem reading this document. (135)". I have narrowed this down to the use of a custom font:
So given the following CSS (print2.css):
body, p {
font-family: 'sourcesanspro', sans-serif;
}
And the following DOMPDF code:
<?php
require_once("/dompdf/dompdf_config.inc.php");
error_reporting(E_ALL);
session_start();
$fileName = "testFile.pdf";
ob_start();
echo '<html><head>
<link rel="stylesheet" href="css/print2.css" type="text/css" />
</head><body>
<div class="reportHeader">
<h1 class="reportTitle">Report Title</h1>
</div>
';
echo '<div>Testing 123</div></html>';
$html = ob_get_contents();
file_put_contents("pdfs/tmp", $html);
ob_end_clean();
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$pdfOutput = $dompdf->output();
file_put_contents($fileName, $pdfOutput);
echo $fileName;
?>
The file can be opened absolutely fine using Chrome directly with the custom font in place but from the file system or downloaded and then opened in Adobe, a 135 error is displayed. I can only reproduce this on one server.
What's wrong with the setup of that one server?
Thanks,
Amy