Answer the question
In order to leave comments, you need to log in
Why do images disappear after converting pdf to jpg, only text remains in the output?
Converting the first page of a PDF file to JPG using ImageMagick. I use this link https://github.com/spatie/pdf-to-image
public function convert($source)
{
$pdf = new Pdf($source);
$pdf->setPage(1)
->setCompressionQuality(50)
->setOutputFormat($this->format)
->saveImage($this->getSavePath($source));
return $this->getUrl($source);
}
Answer the question
In order to leave comments, you need to log in
The experience of using this library speaks of slow work. Try to use the gs script directly like this: https://github.com/alekciy/pdf2image/blob/7f8856dc...
In general, I can offer a ready-made conversion service. Based on Yii2, see README.md for deployment description . If you don’t need a code, but quickly convert a PDF, then I have a deployed project in the form of a ready-made service. If necessary, write in a personal.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question