Sub topic 9
Common vector formats
This chapter covers the four vector file formats you will meet most often: SVG, PDF, EPS and AI. It assumes you know the vector model from the earlier chapters: shapes stored as paths, points and styles. It also assumes you can open a file in a text editor and read simple markup.
What makes a format "vector"
A vector format stores drawing instructions instead of pixels. The same file can be shown at any size and the renderer redraws the shapes each time. Some formats can also hold raster images inside them. A PDF with an embedded photo is still a PDF, but the photo part scales like a raster.
SVG
SVG (Scalable Vector Graphics) is an open standard from the W3C. It is plain text in XML, so you can read it, edit it and compress it well.
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="100" viewBox="0 0 200 100">
<rect x="10" y="10" width="80" height="80" fill="#2a6fdb"/>
<circle cx="150" cy="50" r="40" fill="#e5484d"/>
</svg>Browsers render SVG directly. You place it with the same img element used for other images:
<img src="logo.svg" alt="Company logo" width="120">
<img src="photo.jpg" alt="Mountain lake at sunrise" width="600" height="400">SVG fits logos, icons and simple illustrations on the web. Because it is text, it can also be styled with CSS and scripted with JavaScript when inlined in a page.
The viewBox
The viewBox attribute defines the internal coordinate system. The width and height attributes define the displayed size. The browser maps one onto the other, which is why resizing does not lose quality.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="300" height="300">
<path d="M10 80 C 40 10, 65 10, 95 80" fill="none" stroke="#222" stroke-width="4"/>
</svg>The path starts at point (10, 80) with M. The C command draws a cubic Bézier curve using two control points and an end point. The drawing uses a 100-by-100 coordinate space but displays at 300 by 300 pixels, and the curve stays sharp.
PDF (Portable Document Format) is a page description format. It was built to look the same on every device and printer. Text, vector shapes and embedded raster images can all sit on the same page, and fonts can be embedded.
PDF is the usual choice for sending finished artwork to a print shop or sharing multi-page documents. Most vector editors can export to it. It is not designed for editing, and browsers do not treat it as an everyday inline image.
EPS
EPS (Encapsulated PostScript) is an older format based on the PostScript language. It describes a single page of artwork that other documents can place. Print and publishing workflows used it heavily for logos.
EPS has real limits. It does not support transparency well, and browsers cannot display it. Many current tools prefer PDF or SVG, but you will still receive EPS files from older brand packages and print vendors.
AI
AI is Adobe Illustrator's native format. It keeps layers, editable text, artboards and effects, so it is a working file and not a delivery file. Modern AI files are PDF-based internally, which is why some other programs can open them. Treat AI as a source file you keep, then export SVG or PDF from it for others.
Comparison
| Format | Open standard | Best use | Browser display |
|---|---|---|---|
| SVG | Yes | Web logos, icons, illustrations | Yes |
| Yes (ISO 32000) | Print delivery, documents | Viewer only | |
| EPS | Partly (PostScript is Adobe's) | Legacy print and logo handoff | No |
| AI | No | Editable working files | No |
Common errors
- Missing fonts. SVG text that relies on an installed font may look different on another machine. Convert text to outlines, or embed or link the font.
- Assuming vector means vector. A PDF, EPS or SVG can contain only an embedded bitmap. It will blur when enlarged. Zoom in to check.
- Missing viewBox. Without it, an SVG may not scale with its container.
- Sending AI files to clients. They may lack Illustrator or the fonts. Export a PDF or SVG.
Exercise
A client sends a logo as a PDF and asks for a version to use on their website. Which vector format do you export, and what should you check before sending it?
Show answer
Export SVG, because browsers display it directly and it scales cleanly. Check that the viewBox is set, that text is converted to outlines or the font is available, and that the original is true vector artwork, not an embedded bitmap.