Skip to main content
Participant
June 5, 2007
Question

Getting the file type from a placed file

  • June 5, 2007
  • 2 replies
  • 375 views
Hi

I am trying to get the file type from items placed on a page. I know the types available has one of the three interfaces "IImageAttributes", "IEPSAttributes" or "IPDFAttributes", but how can i test whether the placed image is a TIF, JPG ... Of course i could test on the suffix or the file type (mac), but that isnt "secure" enough, since InDesign can place files with no filetype or extension, if they are in an importable format.

What I want in short, is to read the filetype shown in the Info palette, any one knows how to do this?

Jon
This topic has been closed for replies.

2 replies

Participant
June 5, 2007
Thanks, I did take a look in these interfaces, but that didnt solve the problem for eps, pdf and other none raster types.

Instead I found the:

IDataLink->GetNameInfo()

Which gives me the string from the Info palette.
Participating Frequently
June 5, 2007
Hello. Take a look at the IImageFormatAccess interface. The class ID returned is for the image reader and will return kPSImageReadFormatBoss, kJPEGImageReadFormatBoss, kTIFFImageReadFormatBoss for example.

Hans-Juergen