
SVG to PDF
Rasterize an SVG and place it on a one-page PDF sized to the SVG's own viewBox. The page holds a raster of the drawing at the DPI you choose, not vector paths, since no dependency here can write real vector paths into a PDF.
SVG to PDF rasterizes the file with resvg at a chosen DPI, 72, 150 or 300, defaulting to 150. That raster fills a single PDF page whose size is cut from the SVG's own viewBox. Raising DPI only adds pixel density; the physical page never changes. What lands on the page is a picture, not shapes a viewer can edit.
Questions
What DPI options does it offer?
72, 150 or 300, chosen with dpi, 150 by default.
Does raising the DPI change the PDF page size?
No. The page is always sized in points from the SVGs own viewBox, so raising DPI only changes how many pixels of raster detail cover that same fixed physical page.
Is the SVG turned into real vector paths inside the PDF?
No. The page holds a raster image of the drawing at your chosen DPI, not vector shapes, since no dependency this project uses can write real vector paths into a PDF.
What happens if the SVG has no viewBox?
It refuses, since there is then no size to build the PDF page from, and suggests running Set SVG viewBox first to add one.
Can I set a background colour?
Yes, backgroundColor; leaving it blank keeps the rendered raster transparent wherever the SVG itself is transparent.
Compare
| Tool | Runs on the CLI | Live as you type |
|---|---|---|
| SVG to PDF | Yes | No |
| Optimize SVG | Yes | No |
| SVG to PNG | Yes | No |
| Trace a raster image to SVG | Yes | No |