[]
DsPdfJS API / SvgDocument
Represents an SVG document.
get cursiveFont():
Font|null
Gets or sets the font belonging to the Cursive font family.
Font | null
set cursiveFont(
font):void
Gets or sets the font belonging to the Cursive font family.
Font | null
void
get description():
string
Gets the description of the SVG document.
string
get fantasyFont():
Font|null
Gets or sets the font belonging to the Fantasy font family.
Font | null
set fantasyFont(
font):void
Gets or sets the font belonging to the Fantasy font family.
Font | null
void
get fontCollection():
FontCollection|null
Gets or sets the custom FontCollection used for searching fonts and font fallbacks.
FontCollection | null
set fontCollection(
coll):void
Gets or sets the custom FontCollection used for searching fonts and font fallbacks.
FontCollection | null
void
get fontFallbackScope():
FontFallbackScope
Gets or sets a value specifying the scope for searching fallback fonts for the glyphs missing in the mentioned type faces.
set fontFallbackScope(
fallbackScope):void
Gets or sets a value specifying the scope for searching fallback fonts for the glyphs missing in the mentioned type faces.
void
get id():
number
Gets the reference to the object.
number
get monospaceFont():
Font|null
Gets or sets the font belonging to the Monospace font family.
Font | null
set monospaceFont(
font):void
Gets or sets the font belonging to the Monospace font family.
Font | null
void
get om():
ObjectManager
Gets the owner ObjectManager instance.
get restrictedFontLookup():
boolean
Gets or sets a value indicating whether the fonts should be searched in the custom collection only, if any specified. The default is false.
boolean
set restrictedFontLookup(
value):void
Gets or sets a value indicating whether the fonts should be searched in the custom collection only, if any specified. The default is false.
boolean
void
get sansSerifFont():
Font|null
Gets or sets the font belonging to the SansSerif font family.
Font | null
set sansSerifFont(
font):void
Gets or sets the font belonging to the SansSerif font family.
Font | null
void
get serifFont():
Font|null
Gets or sets the font belonging to the Serif font family.
Font | null
set serifFont(
font):void
Gets or sets the font belonging to the Serif font family.
Font | null
void
get title():
string
Gets the title of the SVG document.
string
staticload(svgBytes):SvgDocument
Loads a SvgDocument from a byte array.
Uint8Array
The binary data of the SVG document.
SvgDocument
A new instance of the SVG document.
staticload(om,svgBytes):SvgDocument
Loads a SvgDocument from a byte array.
An object manager that controls the lifetime of the SvgDocument object.
Uint8Array
The binary data of the SVG document.
SvgDocument
A new instance of the SVG document.
staticloadGz(gzSvgBytes):SvgDocument
Loads a SvgDocument from a byte array with gzipped SVG data.
Uint8Array
The binary data of the gzipped SVG document.
SvgDocument
A new instance of the SVG document.
staticloadGz(om,gzSvgBytes):SvgDocument
Loads a SvgDocument from a byte array with gzipped SVG data.
An object manager that controls the lifetime of the SvgDocument object.
Uint8Array
The binary data of the gzipped SVG document.
SvgDocument
A new instance of the SVG document.
free():
void
Detaches the object from the ObjectManager and deallocates its memory, if possible.
void
getIntrinsicSize():
Size|null
Gets the intrinsic size of SVG viewport.
Size | null
The intrinsic size of SVG viewport, or null if the size is undefined.
measure(
x,y):Rect
Calculates the content bounds of an SVG document when its viewport is drawn at a specified point.
number
The X coordinate of SVG viewport.
number
The Y coordinate of SVG viewport.
The content rectangle of the resulting image.
measureToRect(
x,y,width,height):Rect
Calculates the content bounds of an SVG document, resizing the SVG viewport to fit into a specified rectangle.
number
The X coordinate of the target rectangle for SVG viewport.
number
The Y coordinate of the target rectangle for SVG viewport.
number
The width of the target rectangle for SVG viewport.
number
The height of the target rectangle for SVG viewport.
The content rectangle of the resulting image.
measureToRect(
bounds):Rect
Calculates the content bounds of an SVG document, resizing the SVG viewport to fit into a specified rectangle.
The target rectangle for SVG viewport.
The content rectangle of the resulting image.
rebind(
omTo):void
Rebinds the object from the current ObjectManager to the specified one.
The new ObjectManager for the object.
void
save(
options?):Uint8Array
Saves the current SvgDocument to a byte array.
The settings for saving the document.
Uint8Array
A byte array with UTF8-encoded SVG data.
saveGz():
Uint8Array
Saves the current SvgDocument to a byte array in SVG.GZ format.
Uint8Array
setCurrentColor(
color):void
Sets the 'currentColor' value used by the SVG renderer.
Color | null
void
setLanguageTags(
langTags):void
Sets the list of cultures to match values of the 'systemLanguage' attribute of SVG elements.
string[] | null
void