Skip to content

Parse PDF, some content appears garbled #60

@sh6x-228

Description

@sh6x-228

For security reasons, I cannot share the problematic PDF file.
The garbled text originally occurred when using the reader.GetPlainText() method from the demo.
After switching to the following approach:

for i := 1; i <= reader.NumPage(); i++ {
    text, e := reader.Page(i).GetPlainText(nil)
    if e != nil {
        continue
    }

    if _, e = w.Write([]byte(text)); e != nil {
        continue
    }
}

to extract the content page by page, the garbled text issue no longer occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions