Illustrator: make EPS bounding box match artboard
I need to produce an EPS file with a specific bounding box using Illustrator. If I export to PDF, the PDF page size will correspond to the artboard. However, if I export to EPS, the bounding box seems to be much larger (or missing entirely, as it displays in A4 size with Ghostscript). How can I get Illustrator to use the artboard size as bounding box for EPS files?
Here's an example drawing with artboard and export settings:
The resulting EPS does not include bounding box information in the header. Here's the beginning:
I would expect a header like this instead (got this by exporting to PDF, which was converted to EPS by Ghostscript).
When opening it with Ghostscript based viewers, I can't get the page size to be the artboard size. They just default to something (e.g. A4 paper).
When opening with Preview, it is cropped to the contents instead of preserving the artboard size:
It is important to preserve bounding box information when embedding the EPS in other documents using various software (e.g. LaTeX).
EPS files automatically include all of the artwork in the document, even if they're outside the artboard.
To make the artboard size match the size of your artwork, select your artwork, select the artboard tool, select Fit to Selected Art under the Presents dropdown in the top-left. Or, if you have a particular size in mind that you want the artboard to be, you can select from the other Preset sizes, or click and drag the artboard corners to resize it manually.
When saving as an EPS, check the Use Artboards box, and click Save. You can enter the artboard page range as well if you have artwork spread across multiple boards and don't want to save them all. This will only save the artwork that's within the artwork bounds. If you choose to Save for Web and export as a JPEG or PNG, you can also control the art size settings there - artboard size or change the dimensions manually.