Php2pdf-How to Use php to modify the content in pdf and ensure the format is not messy

Source: Internet
Author: User
Tags php pdf
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 ..

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.