I had also problems parsing images to mPDF library vía POST or making an AJAX call. When I send some HTML String with an tag on it, it showed me the following error:
“mPDF error: IMAGE Error (http://www.xxxxxx.com/folder/my_image.jpg): Error parsing image file - image type not recognised, and not supported by GD imagecreate”
My solution was, instead of sending tags in my HTML code, send a custom identifier like:
<body>
code code code
insert_image:my_image.jpg
code code code
</body>
—> All this html will be sent in a POST field
Then, in the PHP that will use mPDF I replaced that custom code with the correct tags:
<?php
$content_html = $_POST[‘my_html_code_to_pdf']; // THE POSTED FIELD WITH ALL MY HTML CODE
$content_html = preg_replace("/insert_image*:([a-z_0-9.]*)/“, " <img src='http://www.xxxxxx.com/folder/$1'/> ", $content_html);
$mpdf=new mPDF();
$mpdf->WriteHTML($content_html);
$mpdf->Output();
exit;
?>
And it worked!
Hope this helps!