Wednesday, September 17, 2003

AI export to PDF

Illustrator is still hurting my nerves. I give up reading the documentation and I currently reading comments inside the include files. My current task is to produce a PDF on the document. Easy.

Looking in an include file it says that with the export action you can specify the pdf file format and also you can specifiy additional parameters for that action.
The mistake here is that you must not use the export action but the saveas action.

Another very obscure point (for me at least) is that for some of the options (enum options) you have to use the specific set method (setEnumerated) but this method requires a name in addition to the value. The name is a string value so it's not obvious that you have to use the same name used in the enum in the include file. Probably it derives from the automation model, I don't know. So, for example, in the include file there is:


typedef enum _MyOption
{
opt1 = 1,
opt2
} MyOption


Then in the setEnumerated method you have to use it like:


setEnumerated( "MyOption", opt1 );


Not very intuitive (because you have defines and const for everything else).

And listen, if you want to generate the pdf using you own preferences (pdf version, color settings, and so on), you have to tell him to use the custom set and then specify the options you want.

Last but not least, if AI keeps telling you that the save command is not available at this time, most probably means you have specified wrong parameters....

Good luck.

No comments: