Php2pdf-How to use PHP to modify the contents of the PDF, and ensure that the format is not messy

Source: Internet
Author: User
Title, faced with such a difficult problem;

系统存有一些pdf,这些pdf的内容中存在 $var$ 这样的内容;现在做个php程序读取这个文件然后将 $var$ 中的内容替换成数据库中的内容;最后再将修改后的内容保存;   

Is there any good method or PHP third-party library can solve this problem;
Ps:pdf file with background image

Reply content:

Title, faced with such a difficult problem;

系统存有一些pdf,这些pdf的内容中存在 $var$ 这样的内容;现在做个php程序读取这个文件然后将 $var$ 中的内容替换成数据库中的内容;最后再将修改后的内容保存;   

Is there any good method or PHP third-party library can solve this problem;
Ps:pdf file with background image

Eh, finally to find a less satisfactory way, the client upload PDF to docx, and then through the Phpword template substitution variable method to replace, finally on the server side with LibreOffice to the docx PDF conversion, so barely achieve the effect. Feel that PHP is still not very suitable to do such things, if you want to layout is completely not messy, the submission of the docx document must be written through libreoffic. There is Microsoft Office is very bad, personally try, whether it is LibreOffice or WPS written docx, can be well-formed converted to PDF.

You use PHP's PDF tool to see if you can parse it out, if you could parse it out, you can control it.

  • 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.