MarkedContentItem

MarkedContentItem

Overview

MarkedContentItem is a class in Aspose.PDF FOSS for .NET.

A piece of page content a structure element marks: a run of text in one style on one line, or an image.

This class declares 2 methods for MarkedContentItem objects in .NET programs. Available methods include: SaveImage, ToString. Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: ArtifactSubtype, ArtifactType, Element, Font, FontName, FontSize, and 11 more.

Properties

NameTypeAccessDescription
KindMarkedContentKindReadWhether the item is a text run, an image or a drawing.
ElementStructureElement?ReadThe structure element whose marked content holds the item: the element asked, or a descendant of it (a Link or Span inside a paragraph); null for an artifact’s content (GetArtifactContent).
PagePage?ReadThe page the item is drawn on; null when the content is not in a page of the document.
McidintReadThe marked-content identifier of the (first) sequence the item was read from.
TextstringReadThe run’s text.
HyphenBreaksIReadOnlyList<int>ReadWhere in Text the page broke a word over its line with a hyphen that the text leaves out (“exam-” / “ple” reads “example”, the break at 4): a word processor’s optional hyphen stands there.
FontAspose.Pdf.Text.Font?ReadThe font the run is shown in; null for an image or an unknown font.
FontNamestringReadThe font’s PostScript name without a subset tag (e.g.
FontSizefloatReadThe effective font size in points (the size scaled by the text and current matrices).
IsBoldboolReadWhether the text is bold: a bold face (by its name, weight or flags) or text filled and stroked to look bold.
IsItalicboolReadWhether the text is italic or oblique (by its face’s name, angle or flags).
ForegroundColorColor?ReadThe colour the text is painted in; for a drawing, the colour all its paths are painted in (a stroked path’s stroke, another’s fill), null when they differ.
RectangleRectangleReadThe area the item covers on its page as the page is shown (turned by its /Rotate, where text extraction places its text): the run’s baseline span from its descent to its ascent, or the image’s placement.
RotationintReadThe direction of the run’s baseline on the page as it is shown, in whole degrees counter-clockwise (0: left to right; 90: running up the page); Rectangle is the box a turned run covers.
ImageXImage?ReadThe image; null for a text run.
ArtifactTypeArtifact.ArtifactType?ReadFor an artifact’s content, the artifact’s /Type (Undefined when it states none); null for content a structure element marks.
ArtifactSubtypeArtifact.ArtifactSubtype?ReadFor an artifact’s content, the artifact’s /Subtype (Header, Footer, Watermark …; Undefined when it states none); null for content a structure element marks.

Methods

SignatureDescription
SaveImage(output: Stream)Writes the image as it appears on the page as it is shown: turned and mirrored as its placement and the page’s /Rotate draw it (Image holds it as stored, which a page may draw turned or flipped).
ToString()Calls ToString on this MarkedContentItem instance.

See Also