Logout Developer Knowledgebase Search Adobe Partners Main Adobe Solution Partner Finder Adobe Solution Partner Program Support Developer Knowledgebase Adobe Solution Partner Program Products & Technology Adobe
Developer Knowledgebase

Knowledgebase HomeGraphics Server KB

Overview
Software Development Kits
Developer Knowledgebase
Support
Legal Notices
Feedback
Adobe Solution Partner Program
Join
Find a Solution Partner

Product
Graphics Server
 
Version
2.0
 
Last Edited
25-Aug-2004
 
Document
53245

How To: Determining Illustrator ai file type

Summary
Two techniques to determine if a file with a .ai file extension is an EPS file or a PDF file.


Issue
I have a mixture of Illustrator ".ai" files created by various versions of Illustrator. Some are in EPS format (Illustrator 7 and 8) and some are PDFs (Illustrator 9 and 10).

When I attempt to process a batch of files, I don't know whether to use convertPDFToRaster or to use convertPSToRaster. When the command doesn't match the file, Adobe Server generates an error. How should I handle a mixed batch of .ai files?

Applies To
Adobe Graphics Server
Adobe Document Server

Solution
One way would be by branching in your SDK code after the exception to code that uses the other command.

A faster way is to open the file within your SDK code and look at the first four bytes.
  • If the .ai file is PDF based, the first four characters will be %PDF
  • If not, the .ai file is EPS based. Then call the appropriate command (convertPDFToRaster or convertPSToRaster).
This is quicker than branching on an Altercast error because it eliminates the possibility of having to send the file to Adobe Server twice.

back to top
Was this Knowledgebase document helpful? Yes  No
The articles in this knowledgebase are intended for use by software programmers currently using an Adobe SDK to extend or customize an Adobe product. These articles may be highly technical in nature.
If you have questions about an Adobe Product that are not related to development or an SDK product please visit: http://adobe.com/support/main.html
Copyright © Adobe Systems Incorporated. All rights reserved.
Terms of Use
Online Privacy Policy