Click or drag to resize
Pdf Library for .NET

PdfElement Class

Abstract base class for graphic elements with common styling properties such as colors, transparency, line style, gradient, and transformations (translate, scale, rotate, skew). Concrete shape, text, and image elements inherit these members and are added to a page with Add(PdfPageElement).
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalPdfPageElement
    SelectPdf.UniversalPdfElement
      More

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public abstract class PdfElement : PdfPageElement

The PdfElement type exposes the following members.

Constructors
 NameDescription
Protected methodPdfElement 
Top
Properties
 NameDescription
Public propertyActualText Gets or sets the exact text represented by this element (the structure element's /ActualText entry), used when the drawn glyphs do not map to readable text.
(Inherited from PdfPageElement)
Public propertyAlternateText Gets or sets the alternate text describing this element for assistive technology (the structure element's /Alt entry). Required on figures for PDF/UA conformance.
(Inherited from PdfPageElement)
Public propertyArtifact Gets or sets a value indicating whether this element is an artifact — decorative or layout content that carries no meaning and is excluded from the logical structure (backgrounds, rules, running headers). Takes precedence over TagType.
(Inherited from PdfPageElement)
Public propertyBackColor Gets or sets the background fill color.
Public propertyBlending Gets or sets the blending mode.
Public propertyColorSpace Gets or sets the color space for the pdf element rendering.
Public propertyForeColor Gets or sets the foreground color used for drawing outlines and text.
Public propertyGradient Gets or sets the gradient fill. When set, overrides BackColor for fills.
Public propertyLineStyle Gets or sets the line style for outline drawing.
Public propertyRotated Gets a value indicating whether a rotation has been applied.
Public propertyScaled Gets a value indicating whether a scale has been applied.
Public propertySkewed Gets a value indicating whether a skew has been applied.
Public propertyTagType Gets or sets the structure type used to tag this element in a tagged (accessible) document. Ignored unless the document's tagged mode (PdfDocument.Tagged) is enabled. Null (default) leaves the element untagged unless Artifact is set.
(Inherited from PdfPageElement)
Public propertyTranslated Gets a value indicating whether a translation has been applied.
Public propertyTransparency Gets or sets the transparency level (0 = completely transparent, 100 = completely opaque).
Top
Methods
 NameDescription
Public methodRotate Applies a rotation transformation.
Public methodScale Applies a scale transformation.
Public methodSkew Applies a skew transformation.
Public methodTranslate Applies a translation transformation.
Top
Example
PdfDocument document = new PdfDocument();
PdfPage page = document.AddPage();
PdfRectangleElement rect = new PdfRectangleElement(20, 20, 200, 100);
rect.BackColor = new PdfColor(0, 120, 215); // inherited styling
rect.ForeColor = new PdfColor(0, 0, 0);
rect.Transparency = 80;                     // 0 = transparent, 100 = opaque
rect.Rotate(15);                            // inherited transform
page.Add(rect);
document.Save("out.pdf");
document.Close();
See Also
Inheritance Hierarchy