Solved

PHP - document to pdf upload converter php code

Posted on 2011-09-23
9
465 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
Comment Utility
0
 

Author Comment

by:Biertan
Comment Utility
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
Comment Utility
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
 

Author Comment

by:Biertan
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 11

Expert Comment

by:maeltar
Comment Utility
0
 
LVL 11

Expert Comment

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

0
 

Author Comment

by:Biertan
Comment Utility
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 500 total points
Comment Utility
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
Comment Utility
Thank you very much for your help - awesome!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Bada platform is becoming more and more famous this days and people talking about same. Some friends included those who have bada OS mobile asked me "what is bada?"and "what its features?". That encouraged me to research and write this article. [st…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now