mPDF error: Unable to find xref table
<p>When I am trying to upload a pdf file and separating each page as pdf, with some pdf files it is working but some of pdf files show this error:</p>

<pre><code>mPDF error: Unable to find xref table -" Maybe a Problem with auto_detect_line_endings"
</code></pre>

<p><strong>My code:</strong></p>

<pre><code>ini_set('memory_limit', '512M');
$pagecount = Model::count_pages($documentPath.$journalDoc);
for ($i=1; $i&lt;=$pagecount; $i++) {
    $pdf = new mPDF('','Letter',12,'helvetica, sans-serif',200,0,0,20,0,10,'P');
    $pdf-&gt;SetImportUse();
    $pdf-&gt;SetSourceFile($documentPath.$journalDoc);
    $import_page = $pdf-&gt;ImportPage($i);
    $pdf-&gt;UseTemplate($import_page);
    $pdf-&gt;Output($output_dir.$i.'.pdf', 'F');
}   
</code></pre>