Such as the question, facing such a problem; {code ...} is there any good way or a third-party php library to solve this problem? PS: the PDF file has background images such as the question, and faces such a problem;
The system has some pdf files containing content such as $ var $. Now, a php program reads the file and replaces the content in $ var $ with the content in the database; finally, save the modified content;
Is there any good way or a third-party php library to solve this problem;
PS: PDF files with background images
Reply content:
Such as the question, face such a difficult problem;
The system has some pdf files containing content such as $ var $. Now, a php program reads the file and replaces the content in $ var $ with the content in the database; finally, save the modified content;
Is there any good way or a third-party php library to solve this problem;
PS: PDF files with background images
Finally, I found a method that was not satisfactory. I uploaded a pdf file to docx on the client and replaced it with the template in phpword, finally, use libreoffice on the server to convert docx to PDF, which barely achieves the effect. It seems that php is not suitable for such a task. If the layout is not messy, the submitted docx document must be written through libreoffic. Another reason is that Microsoft's office is amazing. I tried it myself. Both libreoffice and docx compiled by wps can be converted to pdf in good layout.
You can use the php pdf tool to check whether it can be parsed. If it can be parsed, you can control it by yourself ..