Subsections

Illustrator  puts wrong MediaBox into saved PDF

bug-ID: ILL10-2002-01-11


When Illustrator 9 & 10 save artwork as PDF, the /MediaBox is set to the size of the canvas (i.e. to the full page) rather than the natural bounding-box for the artwork.

Software Versions

Reported by:

Ross Moore, 11 January 2002; revision and work-arounds added, 5 May 2004.


This is arguably not a bug at all, since a correct bounding-box is deducible from the /ArtBox stored in the PDF. Yet we report it as a bug, because:

Certainly a user cannot get the desired result in the usual way for importing images, but must search for extra import options, or pre-process the image using other software (see the work-arounds below).

Example



(Click on an image to download the corresponding file.)
Illustrator  artwork ...saved as EPS... ...then `distilled' to PDF
bugtest1_ai.jpg bugtest1_eps.jpg bugtest1_dist5.jpg
bugtest1.ai bugtest1.eps bugtest1_dist5.pdf
(size = 236k) (size = 352k) (size = 4.8k)
...saved as PDF (Acrobat4) ...saved as PDF (Acrobat5)
bugtest1_ar5.jpg bugtest1_ar5.jpg
bugtest1_ar4.pdf bugtest1_ar5.pdf
(size = 5.0k) (size = 5.1k)

Note that the two ways to get a PDF file give different results.

Further Information




Suggested Fix

Either ...
When selecting Save As Acrobat PDF set the /MediaBox to be the size of the minimal rectangle surrounding the visible artwork.
Or ...
Include an option to allow the user to specify whether to set the /MediaBox to include just the visible artwork (/ArtBox) or leave it as the whole page. Use a check-box for this choice.




Work-arounds

Here are some ways to work with PDF images that exhibit this problem.
Crop the image.
With a program such as Acrobat  (Full version) or Acrobat 6 Professional, there is an option under the Document menu (check the submenus!) which allows a page to be cropped.

... for pdf-TEX:
Use coding in the document preample:
\expandafter\ifx\csname pdfoptionalwaysusepdfpagebox\endcsname\relax
   \pdfoptionalwaysusepdfpagebox 5 %
\fi
This works since pdf-TEX detects and records various boxes: /MediaBox, /CropBox, /BleedBox, /TrimBox, /ArtBox that may have been recorded in the PDF file. The /ArtBox is #5 in this list.

Ross Moore 2004-05-05