Home  >  Article  >  Backend Development  >  How to convert php pdf to word

How to convert php pdf to word

藏色散人
藏色散人Original
2020-11-25 10:08:294376browse

php How to convert pdf to word: first find a PDF file; then parse the pdf file through PdfParser; finally use "PHPOffice/PHPWord" to convert the pdf into word.

How to convert php pdf to word

The operating environment of this tutorial: Windows 7 system, PHP version 5.6. This method is suitable for all brands of computers.

Recommended: "PHP Video Tutorial"

php converts a pdf file into a word file:

PdfParser (https ://www.pdfparser.org/demo) This is used to parse pdf

PHPOffice/PHPWord (https://github.com/PHPOffice/PHPWord) This is used to convert to word

When word is dumped to xml, the image can exist in base64 encoding, and these encodings are placed in the ba5eb59130347ddcf33292d1909f6483 tag. Replace these base64 encodings with placeholders (${field30} in the code below) and then perform normal processing to display them normally.

Xml code

  
  
      
      
          
          
          
          
          
          
          
          
          
          
          
          
      
      
      
  
${field30}  
  
  
  

The above is the detailed content of How to convert php pdf to word. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn