Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PHP - document to pdf upload converter php code

Posted on 2011-09-23
9
Medium Priority
?
489 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

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

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
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 +…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

719 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