PDFsharp-net6

StructureBuilder

Namespace: PdfSharp.UniversalAccessibility

Helper class that adds structure to PDF documents.

public class StructureBuilder

Inheritance ObjectStructureBuilder

Properties

CurrentStructureElement

Gets the current structure element.

public PdfStructureElement CurrentStructureElement { get; }

Property Value

PdfStructureElement

Methods

BeginElement(PdfGroupingElementTag)

Starts a grouping element.

public void BeginElement(PdfGroupingElementTag tag)

Parameters

tag PdfGroupingElementTag
The structure type to be created.

BeginGroupingElement(String)

Starts a grouping element.

public void BeginGroupingElement(string tag)

Parameters

tag String

BeginElement(PdfBlockLevelElementTag)

Starts a block-level element.

public void BeginElement(PdfBlockLevelElementTag tag)

Parameters

tag PdfBlockLevelElementTag
The structure type to be created.

BeginBlockLevelElement(String)

Starts a block-level element.

public void BeginBlockLevelElement(string tag)

Parameters

tag String

BeginElement(PdfInlineLevelElementTag)

Starts an inline-level element.

public void BeginElement(PdfInlineLevelElementTag tag)

Parameters

tag PdfInlineLevelElementTag
The structure type to be created.

BeginInlineLevelElement(String)

Starts an inline-level element.

public void BeginInlineLevelElement(string tag)

Parameters

tag String

BeginElement(PdfIllustrationElementTag, String, XRect)

Starts an illustration element.

public void BeginElement(PdfIllustrationElementTag tag, string altText, XRect boundingBox)

Parameters

tag PdfIllustrationElementTag
The structure type to be created.

altText String
The alternative text for this illustration.

boundingBox XRect
The element’s bounding box.

BeginIllustrationElement(String, String, XRect)

Starts an illustration element.

public void BeginIllustrationElement(string tag, string altText, XRect boundingRect)

Parameters

tag String

altText String

boundingRect XRect

BeginArtifact()

Starts an artifact.

public void BeginArtifact()

BeginElement(PdfLinkAnnotation, String)

Starts a link element.

public void BeginElement(PdfLinkAnnotation linkAnnotation, string altText)

Parameters

linkAnnotation PdfLinkAnnotation
The PdfLinkAnnotation this link is using.

altText String
The alternative text for this link.

End()

Ends the current element.

public void End()

SetAltText(String)

Sets the content of the “/Alt” (alternative text) key. Used e. g. for illustrations.

public void SetAltText(string altText)

Parameters

altText String
The alternative text.

SetExpandedText(String)

Sets the content of the “/E” (expanded text) key. Used for abbreviations.

public void SetExpandedText(string expandedText)

Parameters

expandedText String
The expanded text representation of the abbreviation.

SetLanguage(String)

Sets the content of the “/Lang” (language) key. The chosen language is used for all children of the current structure element until a child has a new language defined.

public void SetLanguage(string language)

Parameters

language String
The language of the structure element and its children.

SetRowSpan(Int32)

Sets the rowspan of a table cell.

public void SetRowSpan(int rowSpan)

Parameters

rowSpan Int32
The number of spanning cells.

SetColSpan(Int32)

Sets the colspan of a table cell.

public void SetColSpan(int colSpan)

Parameters

colSpan Int32
The number of spanning cells.

BeginMarkedContentInternal(StructureElementItem)

Starts the marked content. Used for every marked content with an MCID.

internal void BeginMarkedContentInternal(StructureElementItem steItem)

Parameters

steItem StructureElementItem
The StructureElementItem to create a marked content for.

EndMarkedContentsWithId()

Ends all open marked contents that have a marked content with id.

public void EndMarkedContentsWithId()

OnAddPage()

Called when AddPage was issued.

internal void OnAddPage()

OnDrawString()

Called when DrawString was issued.

internal void OnDrawString()

OnDraw()

Called when e.g. DrawEllipse was issued.

internal void OnDraw()