Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert images (PSD, AI and EPS) to PDF?

Customers of my Django site can upload a print design in: PDF, PSD, AI and EPS. If the filetype they upload is not PDF I want to convert it to PDF.

So my question is: How do I convert Photoshop, Illustrator and CorelDraw files to PDF (programmatically)?

I tried UniConvertor but it: does not support PSD, distorted my AI inputs, and rejected my EPS inputs. Know any workarounds?

I am open to running separate scripts for each filetype. I googled "psd to pdf" but the results all looked like spam. (It seems image conversion is a cottage industry.) Ideally I want open-source but I will take what I can get.

The reason I want everything in PDF is so I can draw bleed lines using ReportLab and return a "proof" to the customer. Also the printing company I use requires PDF.

Thoughts? Suggestions?

like image 721
ram1 Avatar asked Jan 19 '23 04:01

ram1


2 Answers

One solution that does support all of those formats, as well as exporting to PDF, is Gimp. In addition, you can script Gimp with Python.

http://www.gimp.org/docs/python/index.html

It sounds like you can install arbitrary software on the Django server, so as long as you have access to the X server (GUI) this is possible.

like image 76
agf Avatar answered Jan 21 '23 19:01

agf


Photoshop is going to be a tough one, as is Adobe Illustrator. I'm unaware of any kind of command line utility that will export those to PDF. EPS is Encapsulated Post Script, meaning you may have some luck if you grab a copy of GhostScript. It'll depend on how the EPS was created though, and I'd consider it iffy at best.

Corel Draw, AFAIK, is proprietary. I know that you can export the file to PDF from within their program, but I am not aware of any kind of command like utility to accomplish the same (I also worked for a printing company, so I'm fairly familiar with the formats you're referring to).

like image 26
g.d.d.c Avatar answered Jan 21 '23 17:01

g.d.d.c