lopdf
lopdf copied to clipboard
modify PDF document example
When i use the modify PDF document example:
let mut doc = Document::load("example.pdf")?;
doc.version = "1.4".to_string();
doc.replace_text(1, "Hello World!", "Modified text!");
doc.save("modified.pdf")?;
It doesn't works, i get this text oee
on my own PDF document, any help is much apreciated
Is a strange behavior, i am using a pdf generated from illustrator (on windows), is there some guides to export de PDF to modify correctly with lopdf
or is there some recomended software to create a valid PDF file?
Will you upload the example.pdf file for investigation?
Hey, this is my example , i am trying to use it as a template so i can replace the {variable}
texts with my actual value. Its seems the replace its working bu when i visualize the new PDF some charactes doesnt get print
Some text is replaced, but the embeded font encoding is not correct for the new chars, try embed the whole font.
After decompress the file, can see this:
/TT0 1 Tf
15 0 0 15 437.4551 471.002 Tm
[({identi)-1.5 (fication_id})]TJ
{identification_id}
is split into two operands.
I did try with multiple fonts and always i get the same error, what did you mean by try embed the whole font
?
https://publicatorcommunity.zmags.com/hc/en-us/articles/115002482043-Difference-between-full-embedded-fonts-and-embedded-subset