Documentation
¶
Overview ¶
Package svg provides in-process SVG rasterisation helpers for PDF image embedding. The renderer is intentionally pure Go: it uses oksvg/rasterx for paths and a small text overlay pass for basic <text> elements.
Index ¶
Constants ¶
View Source
const DPIForRaster = 150.0
DPIForRaster is the DPI used when rasterising SVG to PNG for PDF embedding.
View Source
const MaxRasterPixels = 50_000_000
MaxRasterPixels caps the total pixel count of an SVG raster target. The dimensions feeding the rasteriser can be attacker-controlled in untrusted SVG input, so an unbounded image.NewRGBA allocation is a memory risk.
Variables ¶
View Source
var ( ErrSVGHasZeroDimensions = errors.New("svg has zero dimensions") ErrSVGTooLarge = htmllimits.ErrSVGTooLarge )
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.