# PHP code 2 convert .doc file into .pdf file



## jeephp (Feb 27, 2006)

Hello Friends,

I need to convert the DOC (WordFile) in to PDF through PHP code in my web. According to requirement whenever the user upload the .Doc file code should convert that .Doc file into .PDF file at runtime.

I have tried by using PDFLib and FPDF functions but  when the .Doc file contains the images,tables etc. either FPDF or PdfLib being falied to generate PDF file 

I am using Linux-PHP-MySQL Technolgoies for development.

I am expecting suggestions and help from expert friends who can help me out to achive this.

Thanks!


----------



## elander (Feb 28, 2006)

A few years back I built a system that did this, involving OpenOffice to convert the .doc to xml via a shell script, and then converting the xml to pdf via xsl-fo in Cocoon (with the Apache FOP). Worked out pretty well. Unfortunately I've since left the company, and I don't have the documentation of the process, but it shouldn't be impossible to recreate...


----------



## billbaloney (Mar 9, 2006)

Yeah, I think you're going to have to outsource from PHP to accomplish this.  A while ago I developed part of an app that used POI libraries to convert a Word doc to XML.  I'm not sure which is more usable and reliable, OpenOffice or POI, but I'd bet it's OpenOffice, which probably receives more attention than does the POI project.


----------

