Solved

PHP - document to pdf upload converter php code

Posted on 2011-09-23
9
479 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
Don't Miss ATEN at InfoComm 2017!

Visit booth #2167 to see the  new ATEN VM3200 32 x 32 Modular Matrix Switch. Other highlights include the VE8950 4K HDMI Over IP Extender, VS1912 12-Port DP Video Wall Media Player  and VK2100 ATEN Control System. Register now with Free Pass Code ATEN288!

 

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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
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…

752 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