smalot/pdfparser

(Question) Replace an Image inside a PDF

juanborras opened this issue · 4 comments

Hey there!

What I'm trying to achieve is the reduction of the size of the embedded images inside a PDF. Iterate on them and for each, get the image, compress/reduce quality and "put it back". Is this possible?

Thanks!

Not to my knowledge. PDFParser only handles "parsing" jobs, it can't manipulate a PDF.

You can do this online with Adobe's Compress PDF tool: https://www.adobe.com/acrobat/online/compress-pdf.html

You can do this online with Adobe's Compress PDF tool: https://www.adobe.com/acrobat/online/compress-pdf.html

I would like to do it inside PHP in order to automatice it

This is out of scope of this library. You could try https://github.com/tecnickcom/TCPDF or https://manuals.setasign.com/.