Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/docxml/src/components/Image.ts>Image

TypeScript (component) library for building and parsing a DOCX file
Go to Latest
class Image
extends Component<ImageProps, ImageChild>
import { Image } from "https://deno.land/x/docxml@5.5.4/src/components/Image.ts";

A component that represents an image in your DOCX document. You can create a new image by passing any promise to an Uint8Array into the data prop, eg. get it from your file system or from a web request.

Methods

ensureRelationship(relationships: RelationshipsXml)

An event hook with which this component can ensure that the correct relationship type is recorded to the relationship XML.

toNode(_ancestry: ComponentAncestor[]): Node

Creates an XML DOM node for this component instance.

Static Properties

readonly
children: string[]
readonly
mixed: boolean

Static Methods

fromNode(node: Node): Image

Instantiate this component from the XML in an existing DOCX file.

matchesNode(node: Node): boolean

Asserts whether or not a given XML node correlates with this component.