DatsunBing
DatsunBing

Reputation: 9076

Using Google Cloud or Drive to Programatically Convert Word to PDF

Candidates use my PHP application to upload their CV in either Word or PDF format. I want to convert the Word documents (doc or docx) to PDF. I have tried using on-server solutions (PHP libraries), but can not find one that is reliable enough so I am now exploring Google solutions.

It seems that the Drive API has just what I need. I can:

The problem is that (as far as I can see), the only way I can access the Drive API is via OAuth 2, which is quite an overhead in the case of simple server-to-server access. I would prefer to use a simple API key.

As far as I can see, if I want to use an API key, then I need to sign up for a Google Service Account, which again seems like quite an overhead. (I only want to convert some files, right?).

Is there a straightforward way to achieve my goal (using Google resources)? Or are the two options above my only choices?

Upvotes: 5

Views: 1087

Answers (1)

pinoyyid
pinoyyid

Reputation: 22306

Your use case is a perfect fit for a Service Account. It's not really much of an overhead, say 10 minutes to set up the account and a couple of hours to write the auth code. If you would rather use a regular account, check out How do I authorise an app (web or installed) without user intervention? which has step by step instructions and sample code.

Upvotes: 2

Related Questions