HtmlFragment

Overview

HtmlFragment is a class in Aspose.PDF FOSS for .NET. Inherits from: BaseParagraph.

Represents an HTML content fragment that can be added to PDF pages via HeaderFooter.Paragraphs or Page.Paragraphs.

This class provides 2 methods for working with HtmlFragment objects in .NET programs. Available methods include: Clone, HtmlFragment. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: HorizontalAlignment, HtmlContent, HtmlLoadOptions, Hyperlink, HyperlinkText, IsBreakWords, and 10 more.

Properties

NameTypeAccessDescription
IsBreakWordsboolRead/WriteWhether the HTML loader is allowed to break words at line ends.
IsParagraphHasMarginboolRead/WriteWhether the resulting paragraph carries the fragment’s own margin.
HtmlContentstring?Read/WriteThe raw HTML content.
HtmlLoadOptionsHtmlLoadOptions?Read/WriteOptions for HTML loading (font embedding, encoding, etc.).
MarginMarginInfoRead/WriteMargins for the fragment.
IsInNewPageboolRead/WriteWhether this fragment should start on a new page.
IsKeptWithNextboolRead/WriteKeep this fragment together with the next paragraph on the same page.
TextStateAspose.Pdf.Text.TextState?Read/WriteDefault text state applied to the converted HTML output.
RectangleSystem.Drawing.RectangleFReadBounding rectangle of the rendered fragment on the page.
HorizontalAlignmentHorizontalAlignmentRead/WriteHorizontal alignment applied to this paragraph.
VerticalAlignmentVerticalAlignmentRead/WriteVertical alignment applied to this paragraph.
IsFirstParagraphInColumnboolRead/WriteForce the paragraph to start a new column.
IsInLineParagraphboolRead/WriteInline paragraph flag (does not start a new line).
HyperlinkTextstring?Read/WriteLegacy string-typed hyperlink target.
HyperlinkHyperlink?Read/WriteTyped hyperlink decoration applied to the paragraph.
ZIndexintRead/WriteZ-order index used by the DOM renderer.

Methods

SignatureDescription
HtmlFragment(text: string)Create an HtmlFragment from an HTML string.
Clone()Shallow clone — the HTML string and reference-typed properties are shared.

See Also