0

A client has given me the task of creating a site with the ability to convert their file uploads into html or pdf for storage on the web server. I want them to be able to upload (.doc, .tiff, .jpg, etc) and have it convert these files on the fly, again... into either html or pdf.

I am open to software and api's that do the trick but the file MUST BE STORED ON THE CLIENTS WEB SERVER after conversion. The client is using godaddy with an ssl if that helps. Any input is greatly appreciated as I have been looking for a long term solution to this problem that I will be able to use in future projects.

Things I have looked into but have had trouble using this way... Scribd, open office api

Places I've found the most help so far here

madth3
  • 7,275
  • 12
  • 50
  • 74

1 Answers1

0

Well...the matter of storing the file as HTML...as you upload images all you need to do is store the file somewhere and then create a HTML file that looks something like this:

<html>
    <body>
         <img src="path/to/the/image/file.png" />
    </body>
</html>

It might be worth it to convert the large files (especially TIFF) to another format. Converting .doc-Files might be a little more tricky. Have a look here: Convert .doc to html in php

Maybe also take a look at the Document zetaComponent, which is able to cobvert between different document types, although not all of those you mentioned are supported so far.

Creating a PDF should be almost as easy as there are several libraries for PHP that can aid you. Just poke around on SO: Convert HTML + CSS to PDF with PHP?

Overall you will have to mix up a whole lot of stuff to get that job done. There is no "simple" solution to this.

Community
  • 1
  • 1
Till Helge
  • 9,253
  • 2
  • 40
  • 56