# PdfTextStampOptions

Options used when adding a simple text stamp or watermark to parsed PDF pages.

Class 

`OfficeIMO.Pdf`

**Namespace**

`OfficeIMO.Pdf`

**Assembly**

`OfficeIMO.Pdf`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[PdfTextStampOptions.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L16)

**Implements**

`IPdfOperationCancellation`

**Modifiers**

sealed

Options used when adding a simple text stamp or watermark to parsed PDF pages.

## Inheritance

- object
- PdfTextStampOptions

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Watermarks, Stamps, and Metadata](/docs/pdf/watermarks-stamps/) Guide
  
  Add text or image watermarks and stamps to new or existing PDFs and set title, author, and keywords with OfficeIMO.Pdf and PSWriteOffice.

## Usage

Explore 4 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 2

- Method [PdfTextStampOptions.UsePageRange](/api/pdf/officeimo-pdf-pdftextstampoptions/#method-usepagerange-int32-int32)
- Method [PdfTextStampOptions.UsePageRanges](/api/pdf/officeimo-pdf-pdftextstampoptions/#method-usepageranges-officeimo-pdf-pdfpagerange)

### Accepted by parameters 2

- Method [PdfDocumentStamper.Text](/api/pdf/officeimo-pdf-pdfdocumentstamper/#method-text-string-officeimo-pdf-pdftextstampoptions-threading-cancellationtoken) parameter `options`
- Method [PdfDocumentStamper.TextWatermark](/api/pdf/officeimo-pdf-pdfdocumentstamper/#method-textwatermark-string-officeimo-pdf-pdftextstampoptions-threading-cancellationtoken) parameter `options`

Filter members 

Show inherited

## Constructors

`public PdfTextStampOptions()` [#](#constructor-ctor)

[PdfTextStampOptions.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L16)

## Methods

UsePageRange 2 overloads

`public PdfTextStampOptions UsePageRange(int firstPage, int lastPage)` [#](#method-usepagerange-int32-int32)

[PdfTextStampOptions.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L36)

Selects an inclusive one-based page range to stamp.

Parameters

**firstPage int required**

**lastPage int required**

Returns

`PdfTextStampOptions`

`public PdfTextStampOptions UsePageRange(PdfPageRange pageRange)` [#](#method-usepagerange-officeimo-pdf-pdfpagerange)

[PdfTextStampOptions.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L44)

Selects an inclusive one-based page range to stamp.

Parameters

**pageRange OfficeIMO.Pdf.PdfPageRange required**

Returns

`PdfTextStampOptions`

`public PdfTextStampOptions UsePageRanges(params PdfPageRange[] pageRanges)` [#](#method-usepageranges-officeimo-pdf-pdfpagerange)

[PdfTextStampOptions.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L53)

Selects inclusive one-based page ranges to stamp. Overlapping ranges are treated as one page selection set in first-seen order.

Parameters

**pageRanges OfficeIMO.Pdf.PdfPageRange[] required**

Returns

`PdfTextStampOptions`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public int[]? PageNumbers { get; set; }` [#](#property-pagenumbers)

[PdfTextStampOptions.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L25)

One-based page numbers to stamp. When null or empty, every page is stamped.

`public OfficeLength? X { get; set; }` [#](#property-x)

[PdfTextStampOptions.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L61)

Physical X coordinate of the text baseline origin from the unrotated PDF origin. When null, stamps sit 36 points from the lower-left corner of the displayed page and watermarks center in it.

`public OfficeLength? Y { get; set; }` [#](#property-y)

[PdfTextStampOptions.cs:67](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L67)

Physical Y coordinate of the text baseline origin from the unrotated PDF origin. When null, stamps sit 36 points from the lower-left corner of the displayed page and watermarks center in it.

`public PdfStandardFont Font { get; set; }` [#](#property-font)

[PdfTextStampOptions.cs:73](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L73)

Standard PDF font used for the stamp.

`public OfficeLength FontSize { get; set; }` [#](#property-fontsize)

[PdfTextStampOptions.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L84)

Physical text size. Defaults to 24 points.

`public OfficeColor Color { get; set; }` [#](#property-color)

[PdfTextStampOptions.cs:94](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L94)

Text color, including alpha. Theme roles resolve against the default theme.

`public double RotationDegrees { get; set; }` [#](#property-rotationdegrees)

[PdfTextStampOptions.cs:101](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L101)

Counter-clockwise text rotation in degrees around the text origin, relative to the displayed page. On a page with /Rotate, unrotated text reads upright as the page is viewed.

`public double Opacity { get; set; }` [#](#property-opacity)

[PdfTextStampOptions.cs:110](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L110)

Text opacity from 0 through 1, multiplied by the text color alpha. Defaults to 1.

`public bool BehindContent { get; set; }` [#](#property-behindcontent)

[PdfTextStampOptions.cs:122](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L122)

Places the new content stream before existing page content when true.

`public OfficeAlignment Align { get; set; }` [#](#property-align)

[PdfTextStampOptions.cs:130](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L130)

Horizontal alignment of the text against [PdfTextStampOptions.X](/api/pdf/officeimo-pdf-pdftextstampoptions/): OfficeAlignment.Left (the default) starts the text at X, OfficeAlignment.Center centres it on X and OfficeAlignment.Right ends it at X. When X is null, centred text uses the page centre and right-aligned text ends 36 points from the right page edge.

`public bool EmbedFont { get; set; }` [#](#property-embedfont)

[PdfTextStampOptions.cs:143](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Pdf/Manipulation/PdfTextStampOptions.cs#L143)

When true (the default), the stamp text uses the installed font that backs [PdfTextStampOptions.Font](/api/pdf/officeimo-pdf-pdftextstampoptions/) in the default theme, the same font documents created by OfficeIMO.Pdf use, embedded as a subset. When no such font is installed, or it lacks a character of the text, the non-embedded standard font is written instead. Set to false to always write the non-embedded standard font.

<!-- PowerForge markdown artifact sha256:F45E7BDC0EC43EAD46E10C7EB29217828A502AB0E67CB1DC0EE34BA21E78C8FB -->
