XML : PHP - Possible to take a base64 encoded pdf data string and compress it?

So I have an XML file that has a base64 encoded data string for a pdf file (that is just an image). This pdf file can be excessively large (14MB). These images are taken from an iPad through a DocuSign session, thus I have no way at the moment of controlling their size before they get to my php listener script from my end (through DocuSign Connect).

However, my script cannot work with such large files (my CRM's API cap is 10MB), and I need a way of compressing this file before I can upload through my CRM's API.

Now if it was just a jpg, it would be ok as there are plenty of ways to compress it in PHP, but it is a PDF. I have found plenty of PHP extensions for making PDFs, but I haven't found any for reading a PDF and extracting an image from it.

So is there a way to extract the image from the PDF through PHP, or perhaps compress the pdf file?

No comments:

Post a Comment