Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a bit confusing and I need your help to undertand my problem.

I have developed a web application (PHP, JQuery) for one of my customer.

Recently, my customer ask me to add a new feature permitting PDF to JPG conversion.

After web browsing, I have discovered that iMagick (Apache licence) PHP extension with GhostScript (GPL licence) is the only solution.

But, as my customer want to sell the web application to others companies, I have to use non-GPL licences.

By the way, this feature is OPTIONAL and the final user must download and install manually iMagick and GhostScript if he his interesting by using the PDF conversion.

Is there someone to tell me if the fact to use Imagick to convert PDF to JPG (and therefore use GhostScript) turns my current proprietary licence to GPL?

And what about if I don't use Imagick but call GhostScript using PHP exec() function?

Is there others non-GPL projects to convert PDF to JPG that I could use with PHP?

Any help would be greatly appreciated.

share|improve this question
Not quite a dupe but see… – Martin Beckett Nov 18 '12 at 19:42
Yeah, I read that, but I can't figure it out if calling GhostScript through a PHP extension is "communicate with separate GhostScript process via a pipe" – sdespont Nov 18 '12 at 19:48
But as I understand, if I call unmodified GPL software using PHP function exec(), it will create a separate process to execute the task without returning objects to use. Therefore, it is allowed. – sdespont Nov 18 '12 at 19:51
Yes, a pipe just means you read/write to the other app as if it was on the commandline, if this isn't possible in PHP you write the pdf to a tmp file, call GS with exec() and read the resulting jpg file – Martin Beckett Nov 18 '12 at 19:53
This is exactly what I do. Thanks for the clarification. – sdespont Nov 18 '12 at 19:57
up vote 3 down vote accepted

Run Ghostsript as a separate process either reading/writing files or directly streaming stdin-stdout. Then your app isn't a derived work of ghostscript which can be freely distributed alongside your app.

share|improve this answer
Thanks for your answer. If I understand well, exec PHP function execute a separate process, so it is allowed. Do you know if using a PHP extension to call GPL software is allowed? – sdespont Nov 18 '12 at 19:15
The correct answer is - that's upto the judge when you go to court! But the reality has been that if you call a GPL app unmodified as a separate process then that's fine - if the user is still free to replace the GPL app. If you wanted to "play nicely" you could have a config option which would allow calling any other pdf->jpg command line app – Martin Beckett Nov 18 '12 at 19:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.