0

I would like to know if it's possible to convert .eps, .ai, and/or .pdf vector graphics into something I can display on a webpage like .png?

I've tried using...

<cfimage action="convert" overwrite="no" destination='image.png' source='image.eps'/>

...but did not work, which wasn't completely unexpected.

I've done as much research as I can and can't seem to find any answers out there. So please don't mark this as vague or duplicate, because I really have looked.

2 Answers2

0

You could use imageMagick to convert from EPS to jpg. Integration would likely be using cfexecute - not ideal. But there might be a jar file out there that you could use.

I would look for a Java solution here Derrick. then embed your solution as needed. there is not a native CF conversion that I know of. You can unpack PDFs and extract content and images out of them - but I sense that's not what you are looking for.

Mark A Kruger
  • 7,183
  • 20
  • 21
  • There's a JNI wrapper for ImageMagick called JMagick that allows access to ImageMagick from Java, but it doesn't look very easy to integrate. https://github.com/techblue/jmagick – James Moberg Jul 08 '15 at 23:04
0

CFX_OpenImage, a Windows C++ CFX tag, uses GraphicsMagick and supports 88 major image formats including EPS (but not AI). We use it because ColdFusion has occasional issues with CMYK images and can be very slow/CPU intensive when resizing large images. It won't be able to write vector images, but will be able to read them and convert them to raster.

http://www.kolumbus.fi/jukka.manner/cfx_openimage/

http://www.graphicsmagick.org/formats.html

Regarding PDFs, you can create thumbnails using CFPDF:

https://wikidocs.adobe.com/wiki/display/coldfusionen/cfpdf

<cfpdf
  action="thumbnail"
  source="C:\WORK\myBook.pdf"
  destination="C:\WORK\Testing_CFPDF"
  overwrite="true"
  hires="yes"
  format="tiff"
  compresstiffs="yes">

CFPDF can also extract images from individual pages:

<cfpdf
  action="extractimage"
  source="../myBook.pdf"
  pages="1-200"
  destination="..\mybookimages"
  imageprefix="mybook">
James Moberg
  • 4,360
  • 1
  • 22
  • 21
  • This solution is "Windows only", but is very easy to install & use. The download comes with 79 ColdFusion sample scripts to demonstrate the syntax and how to use it. – James Moberg Jul 08 '15 at 23:09
  • CFX_OpenImage uses 1.3.18 and is about 3 versions behind GraphicsMagick. I wrote a CustomTag that works with v1.3.21 and performs basic functions like ResizeFit, Crop, AspectCrop & Optimize. http://gamesover2600.tumblr.com/post/125766251344/graphicsmagick-coldfusion-custom-tag – James Moberg Aug 04 '15 at 17:08