I am converting PDF file (contains unicodes, figures, equations of math, chamistry) to Image using Imagick tool.
$pdf = new Imagick();
$pdf->readimage($pdfFile);
$pdf->resetiterator();
$image = $pdf->appendimages(true);
$image->setimageformat(substr($destination, (strlen($destination) - 3), strlen($destination)));
$status = $image->writeimage($destination);
$image->clear();
$pdf->clear();
But now I need to search for specific string in the PDF file then split them and convert into image. Say this is a pdf document:
[integration]
//any integral equation
//another equation
[/integration]
[integration]
//some text and figures
[/integration]
Now I want to cut split the PDF file into two, starting at [integration]
ending at [/integration]
. And finally convert them into images. So the first image will contain:
//any integral equation
//another equation
And the second one:
//some text and figures
Any code/ideas please.