export

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export

func Export(svgData string, opts ExportOptions) ([]byte, error)

Export converts SVG to the specified format

func GetFileExtension

func GetFileExtension(format Format) string

GetFileExtension returns the file extension for a format

func GetMimeType

func GetMimeType(format Format) string

GetMimeType returns the MIME type for a format

Types

type ExportOptions

type ExportOptions struct {
	Format  Format
	Width   int // For raster formats, 0 = use SVG dimensions
	Height  int // For raster formats, 0 = use SVG dimensions
	Quality int // For JPEG, 0-100 (default 90)
	DPI     int // Dots per inch (default 96)
}

ExportOptions configures export settings

func DefaultOptions

func DefaultOptions() ExportOptions

DefaultOptions returns sensible defaults

type Format

type Format string

Format represents an export format

const (
	FormatSVG  Format = "svg"
	FormatPNG  Format = "png"
	FormatJPEG Format = "jpeg"
	FormatJPG  Format = "jpg"
)

func ParseFormat

func ParseFormat(s string) (Format, error)

ParseFormat parses a format string

Jump to

Keyboard shortcuts

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