Replacer.ReplaceToImages
ReplaceToImages(string, ImageSaveOptions, string, string)
Replaces all occurrences of a specified character string pattern with a replacement string in the input file. Renders output to images.
public static Stream[] ReplaceToImages(string inputFileName, ImageSaveOptions saveOptions,
string pattern, string replacement)
| Parameter | Type | Description |
|---|---|---|
| inputFileName | String | The input file name. |
| saveOptions | ImageSaveOptions | The save options. |
| pattern | String | A string to be replaced. |
| replacement | String | A string to replace all occurrences of pattern. |
See Also
- class ImageSaveOptions
- class Replacer
- namespace Wordize.Replacing
- assembly Wordize
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.
public static Stream[] ReplaceToImages(string inputFileName, ImageSaveOptions saveOptions,
string pattern, string replacement, FindReplaceOptions options)
| Parameter | Type | Description |
|---|---|---|
| inputFileName | String | The input file name. |
| saveOptions | ImageSaveOptions | The save options. |
| pattern | String | A string to be replaced. |
| replacement | String | A string to replace all occurrences of pattern. |
| options | FindReplaceOptions | FindReplaceOptions object to specify additional options. |
Examples
Shows how to replace text in the document and save the result as images array.
Stream[] pages = Replacer.ReplaceToImages(MyDir + "Replacing.docx", new Saving.ImageSaveOptions(SaveFormat.Png), "findme", "Replacement Text");
See Also
- class ImageSaveOptions
- class FindReplaceOptions
- class Replacer
- namespace Wordize.Replacing
- assembly Wordize
ReplaceToImages(Stream, ImageSaveOptions, string, string)
Replaces all occurrences of a specified character string pattern with a replacement string in the input file. Renders output to images.
public static Stream[] ReplaceToImages(Stream inputStream, ImageSaveOptions saveOptions,
string pattern, string replacement)
| Parameter | Type | Description |
|---|---|---|
| inputStream | Stream | The input file stream. |
| saveOptions | ImageSaveOptions | The save options. |
| pattern | String | A string to be replaced. |
| replacement | String | A string to replace all occurrences of pattern. |
See Also
- class ImageSaveOptions
- class Replacer
- namespace Wordize.Replacing
- assembly Wordize
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.
public static Stream[] ReplaceToImages(Stream inputStream, ImageSaveOptions saveOptions,
string pattern, string replacement, FindReplaceOptions options)
| Parameter | Type | Description |
|---|---|---|
| inputStream | Stream | The input file stream. |
| saveOptions | ImageSaveOptions | The save options. |
| pattern | String | A string to be replaced. |
| replacement | String | A string to replace all occurrences of pattern. |
| options | FindReplaceOptions | FindReplaceOptions object to specify additional options. |
Examples
Shows how to replace text in the document loaded from stream and save the result as images array.
using (Stream input = File.OpenRead(MyDir + "Replacing.docx"))
{
Stream[] pages = Replacer.ReplaceToImages(input, new Saving.ImageSaveOptions(SaveFormat.Png), "findme", "Replacement Text");
}
See Also
- class ImageSaveOptions
- class FindReplaceOptions
- class Replacer
- namespace Wordize.Replacing
- assembly Wordize
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.
public static Stream[] ReplaceToImages(string inputFileName, ImageSaveOptions saveOptions,
Regex pattern, string replacement, FindReplaceOptions options = null)
| Parameter | Type | Description |
|---|---|---|
| inputFileName | String | The input file name. |
| saveOptions | ImageSaveOptions | The save options. |
| pattern | Regex | A regular expression pattern used to find matches. |
| replacement | String | A string to replace all occurrences of pattern. |
| options | FindReplaceOptions | FindReplaceOptions object to specify additional options. |
Examples
Shows how to replace text in the document using regular expression pattern and save the result as images array.
string replacement = "Replacement Text";
#if PYNET
Stream[] pages = Replacer.ReplaceToImagesRegex(MyDir + "Replacing.docx", new Saving.ImageSaveOptions(SaveFormat.Png), @"[a-zA-Z]{6}\d+", replacement);
#else
Stream[] pages = Replacer.ReplaceToImages(MyDir + "Replacing.docx", new Saving.ImageSaveOptions(SaveFormat.Png), new Regex(@"[a-zA-Z]{6}\d+"), replacement);
#endif
See Also
- class ImageSaveOptions
- class FindReplaceOptions
- class Replacer
- namespace Wordize.Replacing
- assembly Wordize
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.
public static Stream[] ReplaceToImages(Stream inputStream, ImageSaveOptions saveOptions,
Regex pattern, string replacement, FindReplaceOptions options = null)
| Parameter | Type | Description |
|---|---|---|
| inputStream | Stream | The input file stream. |
| saveOptions | ImageSaveOptions | The save options. |
| pattern | Regex | A regular expression pattern used to find matches. |
| replacement | String | A string to replace all occurrences of pattern. |
| options | FindReplaceOptions | FindReplaceOptions object to specify additional options. |
Examples
Shows how to replace text in the document loaded from stream using regular expression pattern and save the result as images array.
using (Stream input = File.OpenRead(MyDir + "Replacing.docx"))
{
string replacement = "Replacement Text";
#if PYNET
Stream[] pages = Replacer.ReplaceToImagesRegex(input, new Saving.ImageSaveOptions(SaveFormat.Png), @"[a-zA-Z]{6}\d+", replacement);
#else
Stream[] pages = Replacer.ReplaceToImages(input, new Saving.ImageSaveOptions(SaveFormat.Png), new Regex(@"[a-zA-Z]{6}\d+"), replacement);
#endif
}
See Also
- class ImageSaveOptions
- class FindReplaceOptions
- class Replacer
- namespace Wordize.Replacing
- assembly Wordize