Copy link to clipboard
Copied
Is it possible in any way to convert an .AI file to a .PNG via ColdFusion. I've used the <cfimage> tag in the past to convert from PNG to JPG (example below). However, an AI file is a whole nother beast.
<!---Convert Image--->
<cfimage source="Image1.png" action="convert" destination="newImage1.jpg" name="newImage" overwrite="yes">
Does anyone know how to tackle this problem programmatically? Is it possible?
Copy link to clipboard
Copied
Not with cfimage. It does not support AI files.
I did not know the answer so I did some digging around. I came across an interesting thread which mentioned newer AI files are like pdfs in a sense. I ran a few brief tests and cfpdf seemed to be able to create thumbnail images of newer AI files. Though I cannot vouch for the quality of the end result.
<cfpdf action="thumbnail"
source = "c:/path/myFile.ai"
format="png" ...>
You might also look into calling an external program, from cfexecute. From what I have read, programs like ImageMagick or Inkscape support AI file conversions, and probably offer more control over the output. Also if this is a one-off task, you might want to remove CF from the equation entirely and use a batch script to do the conversions.
HTH