docs/tools/svg-to-pdf.md
Convert Scalable Vector Graphics (SVG) files to PDF. The tool rasterizes each SVG through the browser's rendering engine, then embeds the result at its native resolution. Useful for turning vector icons, diagrams, and illustrations into portable documents.
| Format | Extensions |
|---|---|
| SVG | .svg |
from_svgs.pdf.Each SVG is read as text, rendered onto a canvas at its intrinsic width and height (defaulting to 800x600 if no dimensions are specified), and exported as PNG. That PNG is then embedded in the PDF using pdf-lib. Transparent areas are filled with a white background.
PDF Quality controls compression after rasterization:
width and height attributes render at 800x600 pixels. For best results, set dimensions in the SVG source before converting.