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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
BoCh
Posts: 2
Joined: 2016-12-15T08:30:13-07:00
Authentication code: 1151

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

Post 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
Last edited by BoCh on 2016-12-15T09:16:06-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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).
snibgo's IM pages: im.snibgo.com
BoCh
Posts: 2
Joined: 2016-12-15T08:30:13-07:00
Authentication code: 1151

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

Post 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?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo »

If IM (via Ghostscript) can see only one only one image, then that's that.
snibgo's IM pages: im.snibgo.com
Post Reply