简体   繁体   English

使用 php 将 doc、docx 转换为 pdf

[英]doc, docx conversion to pdf using php

i've been searching for quite a long now to convert a word document (.doc & .docx ) to pdf.....my application is about taking a word document from clients than converting them to a pdf with added changes ( like header, footer ) to the original document.我一直在寻找将 word 文档(.doc 和 .docx )转换为 pdf 的很长时间......页眉,页脚)到原始文档。 Any suggestions are welcomed.欢迎任何建议。 Thank you谢谢

Look at http://www.phplivedocx.org/ for converting DOC to PDF.查看http://www.phplivedocx.org/将 DOC 转换为 PDF。

Example code with nusoap,http://www.phplivedocx.org/articles/using-livedocx-with-nusoap/ nusoap 示例代码,http: //www.phplivedocx.org/articles/using-livedocx-with-nusoap/

You can call the Docmosis Cloud Services from PHP using a http post or curl command.您可以使用 http post 或 curl 命令从 PHP 调用Docmosis 云服务 It supports doc and docx imports and pdf outputs.它支持 doc 和 docx 导入和 pdf 输出。 It's more intended to perform document manipulations than conversions but perhaps that suits you even better.它更倾向于执行文档操作而不是转换,但也许这更适合您。 Please note I work for the company that created Docmosis.请注意,我为创建 Docmosis 的公司工作。

Hope that helps.希望有帮助。

This is a year old, but for people still looking I found a link to a pretty decent api you can look at and see if it works for your needs.这是一岁了,但对于仍在寻找的人,我找到了一个指向相当不错的 api 的链接,您可以查看它是否适合您的需求。

https://cloudconvert.org/page/api#overview https://cloudconvert.org/page/api#overview

Essentially you use their api and a key they provide when you sign up for an account.本质上,您在注册帐户时使用他们的 api 和他们提供的密钥。 Send all the data for conversions to their servers then get the return.将所有用于转换的数据发送到他们的服务器,然后获得回报。 You can then store it on your own computer, the users computer, or a server of your choosing.然后,您可以将其存储在您自己的计算机、用户计算机或您选择的服务器上。 There is some minimal set up and sign up processes and their Github account walks you through pretty easily.有一些最小的设置和注册过程,他们的 Github 帐户可以很容易地引导您完成。

Check it out and hopefully it is a good choice.检查一下,希望它是一个不错的选择。

We need to install below libraries on server for convert DOC file format to PDF file format:我们需要在服务器上安装以下库以将 DOC 文件格式转换为 PDF 文件格式:

(Libre Office OR Open Office) and Unoconv librarie (Libre Office OR Open Office) 和 Unoconv 库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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