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
| Name | Type | Access | Description |
|---|---|---|---|
Kind | MarkedContentKind | Read | Whether the item is a text run, an image or a drawing. |
Element | StructureElement? | Read | The 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). |
Page | Page? | Read | The page the item is drawn on; null when the content is not in a page of the document. |
Mcid | int | Read | The marked-content identifier of the (first) sequence the item was read from. |
Text | string | Read | The run’s text. |
HyphenBreaks | IReadOnlyList<int> | Read | Where 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. |
Font | Aspose.Pdf.Text.Font? | Read | The font the run is shown in; null for an image or an unknown font. |
FontName | string | Read | The font’s PostScript name without a subset tag (e.g. |
FontSize | float | Read | The effective font size in points (the size scaled by the text and current matrices). |
IsBold | bool | Read | Whether the text is bold: a bold face (by its name, weight or flags) or text filled and stroked to look bold. |
IsItalic | bool | Read | Whether the text is italic or oblique (by its face’s name, angle or flags). |
ForegroundColor | Color? | Read | The 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. |
Rectangle | Rectangle | Read | The 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. |
Rotation | int | Read | The 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. |
Image | XImage? | Read | The image; null for a text run. |
ArtifactType | Artifact.ArtifactType? | Read | For an artifact’s content, the artifact’s /Type (Undefined when it states none); null for content a structure element marks. |
ArtifactSubtype | Artifact.ArtifactSubtype? | Read | For an artifact’s content, the artifact’s /Subtype (Header, Footer, Watermark …; Undefined when it states none); null for content a structure element marks. |
Methods
| Signature | Description |
|---|---|
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. |