---
title: ".ReplaceText (.PdfDocument Objektmethode)"
---
[TOC]

#### Beschreibung

Replaces every occurrence of OldText using a redaction-style overlay (the original text is covered and the new text drawn on top). This does not reflow surrounding text. Call Save afterwards to obtain the modified PDF.

#### Argumente

<table style="table-layout: fixed; width: min(100%, 602px);"><colgroup><col style="width: 23.3%"><col style="width: 16.0%"><col style="width: 60.7%"></colgroup><tr><th><p><strong>Name</strong></p></th><th><p><strong>Typ</strong></p></th><th><p><strong>Beschreibung</strong></p></th></tr><tr><td><p>OldText</p></td><td><p><a href="/smt-school-professional/technische-dokumentation/opus-dokumentation/standard-datentypen/integer/"><u>integer</u></a></p></td><td><p>the text to replace</p></td></tr><tr><td><p>NewText</p></td><td><p><a href="/smt-school-professional/technische-dokumentation/opus-dokumentation/standard-datentypen/integer/"><u>integer</u></a></p></td><td><p>the replacement text (empty to only redact the original)</p></td></tr><tr><td><p>MatchCase</p></td><td><p><a href="/smt-school-professional/technische-dokumentation/opus-dokumentation/standard-datentypen/integer/"><u>integer</u></a></p></td><td><p>(optional) </p><p>1 for case-sensitive search</p><p>0 otherwise (default 0)</p></td></tr><tr><td><p>MatchWholeWord</p></td><td><p><a href="/smt-school-professional/technische-dokumentation/opus-dokumentation/standard-datentypen/integer/"><u>integer</u></a></p></td><td><p>(optional)</p><p>1 to match whole words only</p><p>0 otherwise (default 0)</p></td></tr></table>

#### Rückgabewert [<u>integer</u>](../../../standard-datentypen/integer.md)

number of occurrences replaced

#### Beispiel

| `xxx` |
| --- |
