Skip to main content
Known Participant
February 7, 2019
Answered

create PDF compatible file

  • February 7, 2019
  • 1 reply
  • 3944 views

I have a client that wants to get a warning (in certain cases) that a file is not saved with 'create PDF compatible file' turned on.

I have been looking at the information I can get from the document, but I do not find that info anywhere.

And/or is it possible to enable this option when using WriteDocumentWithOptions ?!

Thanks

Frank

This topic has been closed for replies.
Correct answer LeoTaro

LeoTaro,

My inquiry is really directed towards finding out if PDF compatibility is turned on for a given document.

I did a lot of experiments investigating the dictionaries associated with the document, but nothing helps me there.

I assume the information is probably linked in the file-format-data block, but that information is a non-documented block, and even investigating it does not really give a hint IF it is there at all.

Hence the question remains: is there a way in the Illustrator API/SDK to check if an illustrator file/document is configured to be saved with PDF compatibility on-or-off.

The first thing to check is of course the file format used for saving (that is easy by looking at the associated file format name).

But the second thing then is the actual setting, and that is the thing I cannot find


You are not going to find anything in the document, you might be able to intercept the AIFileFormatMessage and get the information from there. The other options are:

1. Provide your own way of saving documents that always saves with PDF compatibility turned on.

2. Use the kAIDocumentWritePostprocessNotifier to get a notification when a file has been saved, and then examine the saved file to see if it is PDF compatible and if not either resave with PDF compatibility or pop up an error.

1 reply

A. Patterson
Inspiring
February 11, 2019

I'm not sure it's possible to do what you want unfortunately. You can get notification that a Save event has happened, but it doesn't come with details about the save.

Known Participant
February 12, 2019

A.

Thanks for the reply

but it's not only on save that I need this info... I would also need it simply if someone opens a document. So I would need it on the front/open document.

I already check the document dictionary etc, and I do find a lot of info, but not about PDF compatibility...

A. Patterson
Inspiring
February 12, 2019

You can ask for a notifier when a document opens, that's quite straight forward. Should be a notifier example in the SDK. The ones you want will be in AIDocument.h

I don't know if you'll find out information about PDF compatibility though. I'm not sure what information is stored in an accessible way, if any.