public class ContentReplacer
ContentReplacer is a utility class for replacing content (text and images)
in existing PDF (template) documents.
Users can replace content in a PDF page using the following operations:
- Replace an image that exists in a target rectangle with a replacement image.
- Replace text that exists in a target rectangle with replacement text.
- Replace all instances of a specially marked string with replacement string.
The following code replaces an image in a target region. This code also
replaces the text "[NAME]" and "[JOB_TITLE]" with "John Smith"
and "Software Developer" respectively. Notice the square braces ('[' and ']') on
the target strings in the original PDFDoc. These square braces are not included in
the actual function calls below, as they're implicitly added.
Frees the native memory of the object. This can
be explicitly called to control the deallocation of
native memory and avoid situations where the garbage
collector does not free the object in a timely manner.