1

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. Any suggestions are welcomed. Thank you

  • You might want to go for a solution which uses some office program remote controlled, be it ms office, open office, or any other comparable product. Rendering doc files e.g. to PDF is fairly complex, but office products bring along all required capabilities. – mkl Feb 04 '13 at 13:22
  • Thank you for the suggestion. It would be helpful if you can provide some example link in here. Thanks ones again. – Himanshu Rathod Feb 06 '13 at 12:06
  • I had done some office program remote control from Java some years ago, not from php, though. It proved to be quite workable. Thus, i can not present current php code solving your issue, only the positive experience that it can be done and generates good output. – mkl Feb 06 '13 at 13:00

4 Answers4

0

Look at http://www.phplivedocx.org/ for converting DOC to PDF.

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

Muthu Kumaran
  • 17,682
  • 5
  • 47
  • 70
  • Thanks you, i've tried using phpdocx but my generated PDF din't had the images as well as text formatting same as original doc. – Himanshu Rathod Feb 04 '13 at 10:48
0

You can call the Docmosis Cloud Services from PHP using a http post or curl command. It supports doc and docx imports and pdf outputs. 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.

Hope that helps.

Paul Jowett
  • 6,513
  • 2
  • 24
  • 19
0

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.

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

Essentially you use their api and a key they provide when you sign up for an account. 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.

Check it out and hopefully it is a good choice.

Cayce K
  • 2,288
  • 1
  • 22
  • 35
0

We need to install below libraries on server for convert DOC file format to PDF file format:

(Libre Office OR Open Office) and Unoconv librarie