pub fn replace_text(
doc: &mut Document,
page_num: u32,
search: &str,
replacement: &str,
_fonts: &FontMap,
) -> Result<usize>Expand description
Replace all occurrences of search with replacement in a page’s content.
Returns the number of occurrences replaced. Occurrences that cannot be
replaced (unencodable characters, unsupported containers such as Form
XObjects, /ActualText-covered spans) do not count and are not errors.
The replacement is encoded in the original font when possible; otherwise a
Helvetica/WinAnsiEncoding fallback font is injected and reported through
the crate::text_edit API (this wrapper only returns the count).
The fonts parameter is retained for signature compatibility; the engine
builds its own font map.