Replacer Class

Wordize.Replacing.Replacer class. Provides methods intended to find and replace text in the document.

Replacer class

Provides methods intended to find and replace text in the document.

public class Replacer : Processor

Methods

NameDescription
static Create(ReplacerContext)Creates Replacer processor with specified Replacer context.
Execute()Execute the processor action.
From(Stream, LoadOptions)Specifies input document for processing.
From(string, LoadOptions)Specifies input document for processing.
To(List<Stream>, SaveFormat)Specifies output Document streams list.
To(List<Stream>, SaveOptions)Specifies output Document streams list.
To(Stream, SaveFormat)Specifies output stream for the processor.
To(Stream, SaveOptions)Specifies output stream for the processor.
To(string, SaveFormat)Specifies output file for the processor.
To(string, SaveOptions)Specifies output file for the processor.
static Replace(string, string, Regex, string)Replaces all occurrences of a specified character string pattern with a replacement string.
static Replace(string, string, string, string)Replaces all occurrences of a specified character string pattern with a replacement string.
static Replace(Stream, Stream, SaveFormat, Regex, string, FindReplaceOptions)Replaces all occurrences of a specified character string pattern with a replacement string.
static Replace(Stream, Stream, SaveFormat, string, string, FindReplaceOptions)Replaces all occurrences of a specified character string pattern with a replacement string.
static Replace(string, string, SaveFormat, Regex, string, FindReplaceOptions)Replaces all occurrences of a specified character string pattern with a replacement string.
static Replace(string, string, SaveFormat, string, string, FindReplaceOptions)Replaces all occurrences of a specified character string pattern with a replacement string.
static ReplaceToImages(Stream, ImageSaveOptions, Regex, string, FindReplaceOptions)Replaces all occurrences of a specified regular expression pattern with a replacement string in the input file. Renders output to images.
static ReplaceToImages(Stream, ImageSaveOptions, string, string, FindReplaceOptions)Replaces all occurrences of a specified character string pattern with a replacement string in the input file. Renders output to images.
static ReplaceToImages(string, ImageSaveOptions, Regex, string, FindReplaceOptions)Replaces all occurrences of a specified regular expression pattern with a replacement string in the input file. Renders output to images.
static ReplaceToImages(string, ImageSaveOptions, string, string, FindReplaceOptions)Replaces all occurrences of a specified character string pattern with a replacement string in the input file. Renders output to images.

Examples

Shows how to replace text in the document.

int replacements = Replacer.Replace(MyDir + "Replacing.docx", ArtifactsDir + "Replacer.Replace.docx", "findme", "Replacement Text");

See Also