Solved

PHP - document to pdf upload converter php code

Posted on 2011-09-23
9
483 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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 500 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
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.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

627 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