TextStamp

Overview

TextStamp is a class in Aspose.PDF FOSS for .NET. Inherits from: Stamp.

A text stamp that can be applied to PDF pages.

This class provides 8 methods for working with TextStamp objects in .NET programs. Available methods include: BindImage, BindLogo, BindPdf, BindTextState, SetImageSize, SetOrigin, TextStamp. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: BlendingSpace, Color, DefaultFont, DefaultFontSize, FontName, FontSize, and 19 more.

Properties

NameTypeAccessDescription
DefaultFontFontReadDefault font used when FontName is not set explicitly.
DefaultFontSizefloatReadDefault font size used when FontSize is not set explicitly.
TextstringRead/WriteThe text to stamp.
ValuestringRead/WriteAlias for Text.
FontNamestringRead/WriteFont name (must exist in page resources or be a Standard 14 font).
FontSizefloatReadFont size in points.
ColorColorRead/WriteText color.
TextStateTextStateRead/WriteText formatting state.
WordWrapboolRead/WriteWhether to wrap text at Width boundary.
WordWrapModeTextFormattingOptions.WordWrapModeRead/WriteWord-wrap mode applied to the stamp text.
WidthdoubleRead/WriteWidth constraint used for word wrapping (in points).
HeightdoubleRead/WriteHeight constraint for the stamp box.
ScaleboolRead/WriteWhen true, the stamp text is scaled to fit Width × Height.
ZoomdoubleRead/WriteZoom factor applied to the stamp.
TextAlignmentHorizontalAlignmentRead/WriteHorizontal alignment of the text lines inside the stamp box.
StampIdintRead/WriteThe stamp identifier.
Pagesint[]?Read/WritePages to apply the stamp to (1-based).
PageNumberintRead/WriteSingle page number to apply the stamp to (1-based).
XOrigindoubleRead/WriteX origin position in points.
YOrigindoubleRead/WriteY origin position in points.
RotationfloatRead/WriteRotation angle in degrees.
OpacityfloatRead/WriteOpacity (0.0-1.0).
IsBackgroundboolRead/WriteWhether this stamp is in the background.
QualityintRead/WriteJPEG quality (1..100) when the stamp is emitted as a JPEG image.
BlendingSpaceBlendingColorSpaceRead/WriteBlending colour space used when compositing the stamp onto the page.

Methods

SignatureDescription
TextStamp(text: string)Calls TextStamp on this TextStamp instance.
TextStamp(formattedText: FormattedText)Create a TextStamp from a FormattedText (flattens its lines to a single string, joined by ‘\n’).
BindLogo(formattedText: FormattedText)Bind a FormattedText as the stamp’s logo (text stamp).
BindImage(imageData: byte[])Bind raw image bytes as the stamp’s logo (image stamp).
BindPdf(pdfStream: Stream, pageNumber: int)Bind a PDF page (as the stamp source) by stream + 1-based page number.
BindTextState(textState: TextState)Bind a TextState that overrides defaults when the stamp is text-typed.
SetImageSize(width: float, height: float)Set the explicit pixel size at which the image stamp is rendered.
SetOrigin(originX: float, originY: float)Set the origin position.

See Also