-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect extracted text from annotation #77
Comments
Hi @reyjexter , thank you for reporting the issue. I can reproduce the problem, but only when compiling to WASM; when running the following reproduction snippet from the console, the annotation text is returned correctly. This suggests the problem is in the WASM implementation of let pdfium = Pdfium::new(Pdfium::bind_to_library(
Pdfium::pdfium_platform_library_name_at_path("./"),
)?);
let document = pdfium.load_pdf_from_file("./dynamic-template.pdf", None)?;
for page in document.pages().iter() {
let text = page.text()?;
for annotation in page.annotations().iter() {
println!(
"Text: {:?}, bounds: {:?}",
text.for_annotation(&annotation),
annotation.bounds()?
);
}
} |
Yes, the WASM implementation of There will be a delay before the release of 0.8.0, so in the meantime you may want to set |
I can confirm that the change on master works correctly on document I sent. Thanks again and we shouldn't have any issue using |
Good to hear, closing as resolved. |
Hi again! We have an example PDF document which when using
for_annotation
to get the text, it returns weird characters. However when showing logs of page objects text, this doesn't happen.Here's the PDF affected:
https://github.com/reyjexter/pdfium-render-wasm/blob/master/www/dynamic-template.pdf
And the example:
https://github.com/reyjexter/pdfium-render-wasm
Here's how the console log on Chrome looks like:
Thanks and appreciate any help with this issue.
The text was updated successfully, but these errors were encountered: