Spartacus
Spartacus

Reputation: 31

How to Convert Doc to PDF

Here is some background info. I'm on a shared linux server with hostgator.

I've looked at

to no avail.

My server setup either does not support the setup or the program does not do what I need.

I want to programmatically using php

What are my options? Any suggestions...?

Upvotes: 3

Views: 7842

Answers (3)

Paul Jowett
Paul Jowett

Reputation: 6581

If using a web-service is a viable option for your application have a look at Docmosis Cloud services. From your requirement list:

  1. upload doc - yes
  2. produce pdf - yes
  3. watermark - yes
  4. merging - yes - but you'd have to provide a doc or odt version rather than pdf
  5. store in db - your control (you would save the streamed result to the db)
  6. email - yes

Access from PHP is pretty straight forward since you can just HTTPS post a request. Please note I work for the company that develops Docmosis.

Upvotes: 0

AndrewPK
AndrewPK

Reputation: 6150

You may want to consider moving to a VPS in order to install your own modules, or ask hostgator if they'll install one for you.

The best I've seen so far is Pruno for using the OpenOffice API in php - though this will likely be impossible on a shared hostgator server.

Antiword converts word docs to plaintext or postscript, which seems pretty nice - though you'll have to detect which type of document it is as you'll have to process the doc using a different method if it's a docx...though once again, this will likely be impossible on a shared hostgator server.

You may want to consider getting a more programmer friendly host. I use ChicagoVPS (the link is my affiliate link - here's a non-affiliate link) as they have pretty decent performance (my past linode boxes did seem a bit faster regarding CPU tasks), are often featured on lowendbox and you can pretty much always get a 2GB of ram openvz box (from their chicago datacenter) for $7/mo (promo code: 2048).

I had my performance dip once for 2 days, but it was due to some hardware issues and maintenance, they notified me many times a day on the status, and promptly had it fixed so I've stuck with them.

If a vps is not for you, there's webfaction - an awesomely programmer friendly 'shared' host.

Upvotes: 1

Jako
Jako

Reputation: 4901

Have you looked into running OpenOffice in Headless mode? Here's a quick link I found that may get you in the right direction.

http://qugstart.com/blog/linux/openoffice-headless-mode-installation-word-doc-to-pdf-conversion/

Upvotes: 1

Related Questions