简体   繁体   中英

Find & Replace Text with an image in a PDF using PHP

I am currently building a digital signature system for my company and I need to be able to add the signature once signed to a PDF document.

I have been using FPDF & FDPI to overlay the signature onto the document (this works great if the document is static.)

The problem I have is that the document starts out as a word doc and is converted to PDF. The document has 20 pages and tons of fields passed to it by our case management software so to change to PDF will take me ages also it will change in size based on the information passed from the fields.

I was wondering if anyone has come across a way to search & replace text in a PDF or is there a way to parse the document add a signature and re-create a new PDF.

Any help on this would be great as I have spent a week now trying to find a solution.

Oh sorry for lengthy post just trying to get as much info in as possible.

Thanks

Brad

Actually I'm not aware of any class/library in PHP that is able to replace text in a PDF document with other content. If it is possible to convert the "fields" into real PDF form fields, you may check this out (not free!).

Thanks for your reply

I have managed to sort. I am going to parse the document using parserpdf and then find and replace a placeholder in the document with the signature and then re-build the PDF using FPDF.

Bit long winded but tested and works well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM