Is it possible to convert PDF to PNG using the default PHP module such as PDFlib or GD in PHP?
I think there is a library for conversion, such as ImageMagic, but I do not import such an external library.
Unfortunately, PHP standard modules do not have the ability to convert PDF to PNG.
By the way, the PDF lib and GD you mentioned are not standard PHP modules, but for some reason it seems that they happen to be usable.
I'm not familiar with libraries that only PHP completes, but there seems to be a Ghostscript wrapper library.
As you can see in the document on the page above, it looks like ↓.
$transcoder=Ghostscript\Transcoder::create(array(
'timeout' = > 42,
'gs.binaries' = > '/opt/local/gs/bin/gs',
), $logger);
$transcoder->toImage(' document.pdf', 'output.jpg');
'gs.binaries'=>'/opt/local/gs/bin/gs'
, as you may have noticed,
gs must be installed.
PDFlib does not have the ability to image PDF pages.
http://pdflib.jp/product/
Although there is a function to paste images into PDF files, FoxIt is famous for making PDFs into images (effectively viewer functionality) (but PHP is not available).
354 I have saved several codes written in python to a visual studio file.
341 Understanding the Meaning of mpm prefork Settings
356 I want to create an array of sequences from "1" to a specified number.
342 Memory layouts learned in theory don't work out as expected when actually printed as addresses.
© 2023 OneMinuteCode. All rights reserved.