PLEASE HELP ME CANCEL/CLOSE THIS ISSUE
My original search was incorrect, and this is a duplicate (times about 10).
In this file, 18 images are identified. But the following code cannot convert any images:
$pdf = $parser->parseFile($pdfFile) ;
$images = $pdf->getObjectsByType('XObject', 'Image') ;
foreach ($images AS $imgKey => $pdfImage) {
try {
$image = @imagecreatefromstring($pdfImage->getContent()) ;
} catch (Exception $e) {
$image = false ;
}
if ($image)
printf("Image[$imgKey] converted.\n") ;
else
printf("Image[$imgKey] could not be converted.\n") ;
}
The encoding here seems to be 'FlateDecode' for all images in this file. I did not find any help to lead me to believe this should not work. Is my approach incorrect?