Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is javascript capable of exporting specific artboards to a jpg?

Explorer ,
Oct 15, 2010 Oct 15, 2010

I can export a single artboard to a jpg using the GUI but "artboardRange" doesn't do anything when exporting to a jpg.

I can use the artboardRange in the pdf save options and that works fine but, while the artboard selection is there in the jpg export dialog in the windows gui I can't get this to work in javascript.

Am I going to have to copy my content to a separate document containing only what I want and then export from that?

I tried changing the visibility of objects I didn't want on the jpg but that just leaves a blank area in the resulting jpg even with "artboardClipping" = true. Actually, I don't know that artboardclipping even does anything from what I've tried.

Any suggestions or does this just not work in JavaScript with CS4?

Edit:

If I export to a jpg and use the artboards then a separate jpg is made for each artboard included with a prefix of the artboard # in the name, i.e. filename-01.jpg and filename-02.jpg. It'd be great if I could script this correctly.

TOPICS
Scripting
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 16, 2010 Oct 16, 2010

artboardRange doesn't seem to work in CS4.

It worked fine in CS5, in this example I saved all artboards, but I was also able to do 1 or 2 at a time.

http://forums.adobe.com/thread/727945?tstart=0

Translate
Adobe
Community Expert ,
Oct 15, 2010 Oct 15, 2010

It seems "exportFile" is a Document option only. "Artboard" doesn't provide an "exportFile" method ...

Document.exportFile may accept "options", but other than "Options for the file type specified. (Optional)" I cannot find anything that might be useful in the ESTK Help.

(Some minutes later:) Oh, okay, these are explained in the Illy Scripting Ref. Unfortunately, the ExportJPEGOptions don't seem to provide it either -- you already looked for those.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 15, 2010 Oct 15, 2010

Yeah, these are only document methods in Illustrator.

Actually, saveAs using PDFSaveOptions doesn't work right either. If I specify an artboard with artboardRange is doesn't do anything different; it just puts each artboard on a separate page in a pdf. However, if I set artboardRange to an empty string it actually changes the name of the current document to a .pdf and THEN I can resave it by adding the artboardRange during the second try which seems a bit odd.

At this point I don't believe the "Use Artboards" and the "Range" options which are available in the GUI function correctly in Javascript for either saveAs or exportFile which is annoying as I need this to work.

Also, the PDFSaveOptions.artboardRange string is actually validated and must be either blank or a valid range expression. If I have 2 artboards and I specify '3' it'll fail but if I specify '1' or '2' it still saves all of the artboards. The saveMultipleArtboards option does nothing.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 16, 2010 Oct 16, 2010

artboardRange doesn't seem to work in CS4.

It worked fine in CS5, in this example I saved all artboards, but I was also able to do 1 or 2 at a time.

http://forums.adobe.com/thread/727945?tstart=0

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 16, 2010 Oct 16, 2010
LATEST

I was afraid of that. I don't believe Adobe Illustrator CS4 ever had a service pack released for it. It's still 14.0. That's pretty annoying. 😞

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines