svg

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2024 License: MIT Imports: 7 Imported by: 0

README

Package svg provides very limited, experimental support for rendering SVG images to PDFs. In addition to the obvious constraints (e.g., lack of animation), this package does not implement several important SVG features. Here's a rundown of some of them:

  1. There is very limited support for CSS properties.
  2. Support for SVG text elements is unplanned.
  3. Elliptical Arc Curve (A and a) path commands may be improperly rendered.
  4. Mask elements, gradients, and some transparency/opacity-related attributes are not supported.

These limitations preclude the use of this package for certain applications, but it can work with a surprising number of basic SVG images. Running rsvg-convert with the -f svg option on the input SVG prior to its inclusion in the PDF is highly recommended. (This is especially helpful when an SVG contains CSS classes, which gdf does not support.) Making simple manual adjustments to the SVG's source text can also often fix rendering issues.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader) (gdf.XContent, error)

Decode reads from r, which contains the SVG source data, and returns a gdf.XContent representation of the SVG and an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL