DsPdfJS API - v9.1.0
    Preparing search index...

    Class SvgDocument

    Represents an SVG document.

    Hierarchy (View Summary)

    Index

    Accessors

    • get cursiveFont(): Font | null

      Gets or sets the font belonging to the Cursive font family.

      Returns Font | null

    • set cursiveFont(font: Font | null): void

      Gets or sets the font belonging to the Cursive font family.

      Parameters

      Returns void

    • get description(): string

      Gets the description of the SVG document.

      Returns string

    • get fantasyFont(): Font | null

      Gets or sets the font belonging to the Fantasy font family.

      Returns Font | null

    • set fantasyFont(font: Font | null): void

      Gets or sets the font belonging to the Fantasy font family.

      Parameters

      Returns 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.

      Returns FontFallbackScope

    • set fontFallbackScope(fallbackScope: FontFallbackScope): void

      Gets or sets a value specifying the scope for searching fallback fonts for the glyphs missing in the mentioned type faces.

      Parameters

      Returns void

    • get id(): number

      Gets the reference to the object.

      Returns number

    • get monospaceFont(): Font | null

      Gets or sets the font belonging to the Monospace font family.

      Returns Font | null

    • set monospaceFont(font: Font | null): void

      Gets or sets the font belonging to the Monospace font family.

      Parameters

      Returns void

    • 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.

      Returns boolean

    • set restrictedFontLookup(value: boolean): 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.

      Parameters

      • value: boolean

      Returns void

    • get sansSerifFont(): Font | null

      Gets or sets the font belonging to the SansSerif font family.

      Returns Font | null

    • set sansSerifFont(font: Font | null): void

      Gets or sets the font belonging to the SansSerif font family.

      Parameters

      Returns void

    • get serifFont(): Font | null

      Gets or sets the font belonging to the Serif font family.

      Returns Font | null

    • set serifFont(font: Font | null): void

      Gets or sets the font belonging to the Serif font family.

      Parameters

      Returns void

    • get title(): string

      Gets the title of the SVG document.

      Returns string

    Methods

    • Loads a SvgDocument from a byte array with gzipped SVG data.

      Parameters

      • gzSvgBytes: Uint8Array

        The binary data of the gzipped SVG document.

      Returns SvgDocument

      A new instance of the SVG document.

    • Loads a SvgDocument from a byte array with gzipped SVG data.

      Parameters

      • om: ObjectManager

        An object manager that controls the lifetime of the SvgDocument object.

      • gzSvgBytes: Uint8Array

        The binary data of the gzipped SVG document.

      Returns SvgDocument

      A new instance of the SVG document.

    • Detaches the object from the ObjectManager and deallocates its memory, if possible.

      Returns void

    • Gets the intrinsic size of SVG viewport.

      Returns Size | null

      The intrinsic size of SVG viewport, or null if the size is undefined.

    • Calculates the content bounds of an SVG document when its viewport is drawn at a specified point.

      Parameters

      • x: number

        The X coordinate of SVG viewport.

      • y: number

        The Y coordinate of SVG viewport.

      Returns Rect

      The content rectangle of the resulting image.

    • Calculates the content bounds of an SVG document, resizing the SVG viewport to fit into a specified rectangle.

      Parameters

      • x: number

        The X coordinate of the target rectangle for SVG viewport.

      • y: number

        The Y coordinate of the target rectangle for SVG viewport.

      • width: number

        The width of the target rectangle for SVG viewport.

      • height: number

        The height of the target rectangle for SVG viewport.

      Returns Rect

      The content rectangle of the resulting image.

    • Calculates the content bounds of an SVG document, resizing the SVG viewport to fit into a specified rectangle.

      Parameters

      • bounds: Bounds

        The target rectangle for SVG viewport.

      Returns Rect

      The content rectangle of the resulting image.

    • Saves the current SvgDocument to a byte array.

      Parameters

      Returns Uint8Array

      A byte array with UTF8-encoded SVG data.

    • Saves the current SvgDocument to a byte array in SVG.GZ format.

      Returns Uint8Array

    • Sets the 'currentColor' value used by the SVG renderer.

      Parameters

      Returns void

    • Sets the list of cultures to match values of the 'systemLanguage' attribute of SVG elements.

      Parameters

      • langTags: string[] | null

      Returns void