Open axoking opened 2 hours ago
The replace_text function of the Document struct is not working.
replace_text
Document
Example code:
use lopdf::Document; fn main() { let mut doc = Document::load("document.pdf").unwrap(); if let Err(error) = doc.replace_text(1, "Hello World", "Goodbye world") { println!("{error}"); } doc.save("modified.pdf").unwrap(); }
Gives the following output:
ToUnicode CMap error: Could not parse ToUnicodeCMap: Error!
Happens even with a simple PDF document created by libre office (see below): document.pdf document.odt
This is not directly using indexmap -- perhaps you meant to file an issue on lopdf? https://github.com/J-F-Liu/lopdf
indexmap
lopdf
The
replace_text
function of theDocument
struct is not working.Example code:
Gives the following output:
Happens even with a simple PDF document created by libre office (see below): document.pdf document.odt