Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

PHP - document to pdf upload converter php code

Posted on 2011-09-23
9
Medium Priority
?
493 Views
Last Modified: 2012-06-27
I am trying to setup a portal and need to upload pdf documents into it.
Is there any php code available that would allow me to get a local document (Word, Excel, PowerPoit, etc) and in the process of uploading it to the web portal, it gets converted into a pdf file?
0
Comment
Question by:Biertan
  • 5
  • 4
9 Comments
 
LVL 11

Expert Comment

by:maeltar
ID: 36591326
0
 

Author Comment

by:Biertan
ID: 36591367
the PDFonline converter comes close to what I need to do - in a whole, what I'm trying to achieve is to allow a user to select a locally stored document (.doc/x .xls/x .ppt/x etc), then in the action of uploading any of those documents to the web portal, they will be converted and then stored onto the portal as part of the upload process and done serve side, not client side.
0
 
LVL 11

Expert Comment

by:maeltar
ID: 36591417
I think you will need to process the file once uploaded to the server, so I would suggest something on the lines of the following  :

User uploads doc file
Doc file saved to directory on server
Cron job checks directory for files every 2 mins ?
If file exists run pdf conversion
If sucessful
Move converted file into pdf repository
Remove / move original file

0
Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

 

Author Comment

by:Biertan
ID: 36591431
I'm hoping that there may be a way to carry out that process as part of the upload function - by uploading the original file as whatever format then converting it will bring other issues into the process, such as the files not being available for further "processing" as soon as the upload is complete.
0
 
LVL 11

Expert Comment

by:maeltar
ID: 36591436
0
 
LVL 11

Expert Comment

by:maeltar
ID: 36591453
After reading the docs for unoconv  you could probably use that with a php system call ...

0
 

Author Comment

by:Biertan
ID: 36591459
the cost is not the main issue: the ability to carry out the process as we need it (user selects [possibly multiple - eg .doc +.xls + .ppt]) documents to upload, the server based process allows the uploads and when it dumps them in the user's directory they are all in pdf format.
The other thing is for the server process to run on a Linux based system - the portal is not based on a Windows system, hence my question being around a php based process.
0
 
LVL 11

Accepted Solution

by:
maeltar earned 2000 total points
ID: 36591472
I have just tried unoconv on my linux server, and if you use it with --listener it will listen on localhost port 2002 (default) so you could then fire unoconv with the --server to access the instance and stream the file though.

So in theory you could upload the file, stream it to the unoconv instance and the file would appear to be converted on the fly.
0
 

Author Closing Comment

by:Biertan
ID: 36591480
Thank you very much for your help - awesome!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…
Suggested Courses
Course of the Month11 days, 10 hours left to enroll

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question