SVG to PDF — vector stays vector
SVG and PDF are surprisingly close cousins. Both describe vector graphics — shapes, paths, text, fills, strokes — rather than raster pixels. Translation between them is mostly a 1-to-1 mapping of shape primitives, with the trickier work in fonts, embedded raster images, and CSS resolution. The result of an SVG-to-PDF conversion is a PDF page where vector content stays vector: sharp at any zoom, small in file size, suitable for print at any scale.
Why the formats translate cleanly
SVG specifies primitives like <rect>, <circle>, <path>, <text> with attributes for fill, stroke, transform. PDF's content stream uses operators like re (rectangle), m...l...l (move/line for paths), Tj (text). The graphics models are conceptually identical:
- 2D coordinate space.
- Affine transformations stacked through the rendering pipeline.
- Fill and stroke independently controllable.
- Solid, gradient, and pattern fills.
- Clipping paths.
- Text rendered with embedded fonts.
The primary difference is XML vs binary content streams, and CSS vs PDF graphics-state stack. A converter walks the SVG DOM, computes effective styles for each element, and emits PDF operators that produce equivalent rendering.
What happens during conversion
The conversion pipeline reads the SVG's declared width and height, decides whether the SVG fits within an A4 page (~792 × 1123 pt at standard scaling), and either passes the SVG through at its natural size or scales it down to fit. The actual rendering — parsing the XML, resolving CSS and inherited attributes, walking the element tree, and emitting PDF drawing operators — is handled by a mature SVG renderer.
Page size
SVG specifies dimensions through width, height, and/or viewBox attributes on the root <svg> element. When the SVG's natural size is smaller than A4, the resulting PDF page is sized to match the SVG. An SVG with a "100 × 100" viewBox produces roughly a 100 × 100 pt PDF page (about 1.4 × 1.4 inches), not an A4 page with a small image in the corner.
SVGs that exceed A4 — say, a poster authored at 2000 × 2000 — are scaled down to fit within A4 limits. The output PDF page is bounded by ~792 × 1123 pt regardless of how large the source SVG declares itself to be. Zoom and print scaling can recover apparent size; the page itself stays bounded.
Vector stays vector
The strongest property of SVG-to-PDF is preservation: a logo authored as 200 lines of SVG remains 200 lines of PDF operators. Zoom in 1000% and the edges stay perfectly crisp, because the renderer evaluates the underlying shapes at the new resolution.
This is unlike rasterizing an SVG to PNG and then PNG-to-PDF — that path locks in a specific pixel resolution and loses scalability. SVGtoPDF preserves resolution-independence end-to-end.
When rasterization happens
Some SVG features can't be expressed as PDF vector operators and must be rasterized:
- Filters:
feGaussianBlur,feColorMatrix,feTurbulence, etc. PDF has no equivalent; the affected region is rendered to pixels. - Embedded raster images:
<image>tags pointing to PNG/JPG. The raster is preserved as a raster Image XObject in the PDF. - Some complex masks and clip-paths involving alpha gradients.
For SVGs without these features (most logos, icons, charts, simple diagrams), the resulting PDF is fully vector. For SVGs with filters or embedded photos, those regions are rasters in the PDF; the rest stays vector.
Text — the surprising hard part
SVG text uses CSS font properties: font-family: "Helvetica", font-size: 12pt. The renderer needs the actual font file to draw glyphs. Two paths:
- Font available: the renderer loads it from the system and embeds the used glyphs in the PDF. Text remains selectable and copyable from the PDF.
- Font missing: the renderer falls back to a default sans-serif. Glyphs render but the visual layout may differ from the SVG author's intent.
SVGs that reference web fonts (Google Fonts, custom CDNs) fall into the missing-font path — external URLs aren't fetched during conversion. The set of fonts the renderer can use depends on what is installed on the conversion server, which is not controllable by the user. For guaranteed text fidelity, convert text to outlines (<path>) in your SVG editor before uploading, or embed the font as a data URI inside the SVG.
Output quality
For typical use cases — logos, diagrams, icons, charts — the conversion produces tight, sharp PDF output. A 5 KB SVG of a logo becomes a roughly 6 KB PDF (slight framing overhead). Vector quality survives any zoom on screen, and print scaling stays sharp; the PDF page itself is bounded by A4 dimensions, but printers can scale a vector PDF up without quality loss.
For complex, filter-heavy SVGs, the output is larger because filtered regions are rasterized during rendering. Expect the PDF to be 5–10× the SVG size for filter-heavy content.