sempdf

Class: PdfStructureContainer

sempdf v1.9.1


sempdf / PdfStructureContainer

Defined in: src/document.ts:885

Constructors

Constructor

new PdfStructureContainer(
   page, 
   embeddedFonts, 
   node, 
   fontFamilies?, 
   textDefaults?): PdfStructureContainer;

Defined in: src/document.ts:895

Creates a structure container bound to a page, embedded fonts, and parent structure node.

Parameters

ParameterTypeDescription
pageInternalPageModelThe internal page model to write into.
embeddedFontsReadonlyMap<string, ParsedTrueTypeFont>The embedded font registry used for text layout.
nodeInternalStructureNodeThe parent structure node for tagged content.
fontFamiliesReadonlyMap<string, FontFamilyFaces>Font families registered with the document.
textDefaults?TextDefaultsDocument-wide text defaults.

Returns

PdfStructureContainer

Methods

bmp()

bmp(data, options): this;

Defined in: src/document.ts:1042

Adds a tagged BMP image to this structure container.

Parameters

ParameterTypeDescription
dataBinaryDataThe binary image or font data.
optionsBmpImageOptionsOptions that control the operation.

Returns

this


circle()

circle(
   cx, 
   cy, 
   radius, 
   style?): this;

Defined in: src/document.ts:1189

Draws a circle. See PdfPage.circle.

Parameters

ParameterType
cxnumber
cynumber
radiusnumber
style?ShapeStyle

Returns

this


container()

Creates a nested tagged structure container.

Param

The structure tag to create.

Param

Either structure options or a build callback.

Param

An optional build callback when options are provided separately.

Call Signature

container(tag, build?): PdfStructureContainer;

Defined in: src/document.ts:1217

Creates a nested tagged structure container.

Parameters
ParameterTypeDescription
tagPdfContainerTagThe structure tag to create.
build?(container) => voidAn optional callback that receives the created container.
Returns

PdfStructureContainer

The created structure container.

Call Signature

container(
   tag, 
   options?, 
   build?): PdfStructureContainer;

Defined in: src/document.ts:1230

Creates a nested tagged structure container.

Parameters
ParameterTypeDescription
tagPdfContainerTagThe structure tag to create.
options?PdfStructureOptionsOptions that control the operation.
build?(container) => voidAn optional callback that receives the created container.
Returns

PdfStructureContainer

The created structure container.


ellipse()

ellipse(
   cx, 
   cy, 
   rx, 
   ry, 
   style?): this;

Defined in: src/document.ts:1196

Draws an ellipse. See PdfPage.ellipse.

Parameters

ParameterType
cxnumber
cynumber
rxnumber
rynumber
style?ShapeStyle

Returns

this


flow()

flow(options?): PdfFlow;

Defined in: src/document.ts:1344

Creates a flow helper that writes into this structure container.

Parameters

ParameterTypeDescription
optionsFlowOptionsOptions that control the operation.

Returns

PdfFlow

The created flow helper.


gif()

gif(data, options): this;

Defined in: src/document.ts:1097

Adds a tagged GIF image to this structure container.

Parameters

ParameterTypeDescription
dataBinaryDataThe binary image or font data.
optionsGifImageOptionsOptions that control the operation.

Returns

this


image()

image(data, options): this;

Defined in: src/document.ts:1164

Adds a raster image (auto-detecting the format) tagged under this container.

Parameters

ParameterTypeDescription
dataBinaryDataThe image bytes.
optionsJpegImageOptionsPlacement and tagging options.

Returns

this


jbig2()

jbig2(data, options): this;

Defined in: src/document.ts:1053

Adds a tagged JBIG2 image to this structure container.

Parameters

ParameterTypeDescription
dataBinaryDataThe binary image or font data.
optionsJbig2ImageOptionsOptions that control the operation.

Returns

this


jp2()

jp2(data, options): this;

Defined in: src/document.ts:1075

Adds a tagged JPEG 2000 image to this structure container.

Parameters

ParameterTypeDescription
dataBinaryDataThe binary image or font data.
optionsJp2ImageOptionsOptions that control the operation.

Returns

this


jpeg()

jpeg(data, options): this;

Defined in: src/document.ts:1020

Adds a tagged JPEG image to this structure container.

Parameters

ParameterTypeDescription
dataBinaryDataThe binary image or font data.
optionsJpegImageOptionsOptions that control the operation.

Returns

this


line()

line(
   x1, 
   y1, 
   x2, 
   y2, 
   style?): this;

Defined in: src/document.ts:1179

Draws a straight line between two points. See PdfPage.line.

Parameters

ParameterType
x1number
y1number
x2number
y2number
style?ShapeStyle

Returns

this


link(url, options): this;

Defined in: src/document.ts:1120

Adds a tagged URI link annotation to this structure container.

Parameters

ParameterTypeDescription
urlstringThe URI target.
optionsUriLinkOptionsOptions that control the operation.

Returns

this


linkToPage()

linkToPage(target, options): this;

Defined in: src/document.ts:1133

Adds a tagged internal page-link annotation nested under this container, so the Link structure element becomes a child of this node (e.g. a TOCI) rather than a page-level root.

Parameters

ParameterTypeDescription
targetPdfPageThe page to navigate to.
optionsPageLinkOptionsLink rectangle and tagging options.

Returns

this


list()

list(items, options): this;

Defined in: src/document.ts:945

Adds a tagged list to this structure container.

Parameters

ParameterTypeDescription
itemsreadonly ListItem[]The list items to add.
optionsListOptionsOptions that control the operation.

Returns

this


path()

path(commands, style): this;

Defined in: src/document.ts:1203

Adds vector path commands. Mirrors PdfPage.path.

Parameters

ParameterType
commandsPathCommand[]
stylePathStyle

Returns

this


png()

png(data, options): this;

Defined in: src/document.ts:1031

Adds a tagged PNG image to this structure container.

Parameters

ParameterTypeDescription
dataBinaryDataThe binary image or font data.
optionsPngImageOptionsOptions that control the operation.

Returns

this


rect()

rect(
   x, 
   y, 
   width, 
   height, 
   style?): this;

Defined in: src/document.ts:1172

Draws a rectangle. See PdfPage.rect.

Parameters

ParameterType
xnumber
ynumber
widthnumber
heightnumber
style?ShapeStyle

Returns

this


structure()

Creates a nested tagged structure container.

Param

The replacement structure role.

Param

Either structure options or a build callback.

Param

An optional build callback when options are provided separately.

Call Signature

structure(role, build?): PdfStructureContainer;

Defined in: src/document.ts:1281

Creates a nested tagged structure container.

Parameters
ParameterTypeDescription
role| string & object | PdfStandardStructureTagThe replacement structure role.
build?(container) => voidAn optional callback that receives the created container.
Returns

PdfStructureContainer

The created structure container.

Call Signature

structure(
   role, 
   options?, 
   build?): PdfStructureContainer;

Defined in: src/document.ts:1294

Creates a nested tagged structure container.

Parameters
ParameterTypeDescription
role| string & object | PdfStandardStructureTagThe replacement structure role.
options?PdfStructureOptionsOptions that control the operation.
build?(container) => voidAn optional callback that receives the created container.
Returns

PdfStructureContainer

The created structure container.


svg()

svg(data, options): this;

Defined in: src/document.ts:1108

Adds a tagged SVG graphic to this structure container.

Parameters

ParameterTypeDescription
datastring | BinaryDataThe SVG text data.
optionsSvgImageOptionsOptions that control the operation.

Returns

this


table()

table(rows, options): this;

Defined in: src/document.ts:979

Adds a tagged table to this structure container.

Parameters

ParameterTypeDescription
rowsreadonly TableRow[]The table rows to add.
optionsTableOptionsOptions that control the operation.

Returns

this


text()

text(text, options): this;

Defined in: src/document.ts:909

Adds tagged text to this structure container.

Parameters

ParameterTypeDescription
textstringThe text to add.
optionsTextOptionsOptions that control the operation.

Returns

this


textBlock()

textBlock(text, options): this;

Defined in: src/document.ts:927

Adds a tagged multiline text block to this structure container.

Parameters

ParameterTypeDescription
textstringThe text to add.
optionsTextBlockOptionsOptions that control the operation.

Returns

this


tiff()

tiff(data, options): this;

Defined in: src/document.ts:1064

Adds a tagged TIFF image to this structure container.

Parameters

ParameterTypeDescription
dataBinaryDataThe binary image or font data.
optionsTiffImageOptionsOptions that control the operation.

Returns

this


webp()

webp(data, options): this;

Defined in: src/document.ts:1086

Adds a tagged WebP image to this structure container.

Parameters

ParameterTypeDescription
dataBinaryDataThe binary image or font data.
optionsWebpImageOptionsOptions that control the operation.

Returns

this

On this page