Connecting Tech Pros Worldwide Help | Site Map

Vector EPS/PS from PHP & ImageMagick or GD

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 12:16 PM
shanergb
Guest
 
Posts: n/a
Default Vector EPS/PS from PHP & ImageMagick or GD

Hi all. I'm creating a web-based application that uses PHP, MySQL &
Apache on a Windows platform. What I need to do is create images on
the fly with either GD or ImageMagick, display them on the web browser
and then save the file.

The tricky part is the format of that saved file - it needs to be an
EPS format. The image won't be anything terribly exciting - just some
basic shapes (boxes, circles, etc) and some text. No fancy colors,
textures, or effects. It will be imported into a vector-based program
and processed there. That program can only import EPS files, other
than their own proprietary format.

Is this even possible without getting into hardcore programming? Does
ImageMagick or GD offer some kind of vector-based file format? Is
there something that I'm not seeing in the documentation? If this is
better accomplished using the libraries and programs in Linux, that is
certainly an option.

Any help would be greatly appreciated!

Thanks!


  #2  
Old July 17th, 2005, 12:18 PM
Raj Shekhar
Guest
 
Posts: n/a
Default Re: Vector EPS/PS from PHP & ImageMagick or GD

"shanergb" <shane@sthoen.com> writes:

[color=blue]
> The tricky part is the format of that saved file - it needs to be an
> EPS format. The image won't be anything terribly exciting - just some
> basic shapes (boxes, circles, etc) and some text. No fancy colors,
> textures, or effects. It will be imported into a vector-based program
> and processed there. That program can only import EPS files, other
> than their own proprietary format.[/color]

From what I know, you cannot generate EPS files in PHP. If EPS is
your requirement, I think you will have to use Imagemagick. Again
from what I know about Imagemagick, you cannot use it to output
circles, boxes etc. It is mostly used to work with images rather than
figures. You have these options

- Use PHP to generate you figure (there are functions to draw
lines/circles/rectangles), save the figure as TIFF and then use
imagemagick to convert from TIFF to eps (using imagemagick's' convert
utility)

- Use pdflib to generate the pdf with your desired figure and then use
pdf2eps utility to get your eps file

- Use PHP to generate a LaTeX file, this LaTeX file will have the
defination of what figure you want to draw and run this LaTeX file
through latex2eps to get the desired eps file.

- There is a epslib class in PHP (just search for it), but it has been
written by a $RANDOM_GUY. You can use that library to generate your
eps, AFTER you have gone through his code and satisfied yourself
that it is of good quality

[color=blue]
>
> Is this even possible without getting into hardcore programming? Does
> ImageMagick or GD offer some kind of vector-based file format? Is
> there something that I'm not seeing in the documentation? If this is
> better accomplished using the libraries and programs in Linux, that is
> certainly an option.
>[/color]

Imagemagick has support for SVG. However, its support is still not
complete. You will get more info about that on IM's user mailing
list. Check imagemagick.org for supported formats that you can use.

--
Raj Shekhar Y! : Operations Engineer
MySQL DBA, programmer and slacker Y!IM : lunatech3007
home : http://rajshekhar.net blog : http://rajshekhar.net/blog/
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.