Page 1 of 1

How can I remove the first layer when converting an ai-file to jpg

Posted: 2016-12-15T08:46:25-07:00
by BoCh
Hi community,

I have to solve a problem on converting ai (Adobe Illustrator)-Files to web-jpgs. The files are containing two layers (The first is for the measures of the part, the second represents an image or vector-outline drawing of the part) but only one drawing area.
To create a thumbnail-image for our webshop I have to remove the layer with the measures before creating the jpg.
I tried to write the number of the layer in brackets after the filename Lauertest.ai like I should do it when converting a psd-file. But there is only a error-output in the console.

This is my current batch-command:
convert -density 72 -colorspace CMYK -resize 90x90 -quality 100 -gravity center -extent 90x90 Layertest.ai[1] Vorschau/Layertest_1.jpg

version: ImageMagick-6.9.0-Q16
platform: Windows Server 2003 R2 Enterprise x64 Edition
api: shell (later include in a groovy-script)

Error-output:
convert.exe: PDFDelegateFailed `[ghostscript library] ...... Requested FirstPage is greater than the number of pages in the file: 1
No pages will be processed (FirstPage > LastPage).
' @ error/pdf.c/ReadPDFImage/778.
convert.exe: no images defined `Vorschau/Layertest_1.jpg' @ error/convert.c/ConvertImageCommand/3210.

I think the reason is that the ai-file is interpreted like a pdf-file with multiple pages.
Is there anyone out there who can help me to solve the problem?

Thanks for your reply!
Chris

Re: How can I remove the first layer when converting an ai-file to jpg

Posted: 2016-12-15T09:09:48-07:00
by snibgo
BoCh wrote:Requested FirstPage is greater than the number of pages in the file: 1
You ask for page number 1 (counting from zero), but there is no page 1. I suppose there is only one page (number 0).

Re: How can I remove the first layer when converting an ai-file to jpg

Posted: 2016-12-15T09:18:23-07:00
by BoCh
Thanks snigbo,
I tried it also with Layertest.ai[0] -> the output was the full image including the measures. Do you know how to reference the different layers in an ai-file?

Re: How can I remove the first layer when converting an ai-file to jpg

Posted: 2016-12-15T09:43:16-07:00
by snibgo
If IM (via Ghostscript) can see only one only one image, then that's that.