Skip to content

Suppressing the warnings from MuPDF #132

@patppuccin

Description

@patppuccin

I am sure this might not be an Issue, but I needed help on the same.

When I try to extract Text or HTML from a PDF document,.. I get errors like the following:

warning: ignoring CMap range (54-54) that is outside of the codespace
warning: ignoring CMap range (58-58) that is outside of the codespace
warning: ignoring CMap range (66-66) that is outside of the codespace
warning: ignoring CMap range (74-74) that is outside of the codespace
warning: ignoring CMap range (51-51) that is outside of the codespace
warning: ignoring CMap range (75-75) that is outside of the codespace
warning: ignoring CMap range (72-72) that is outside of the codespace
warning: ignoring CMap range (80-80) that is outside of the codespace
warning: ignoring CMap range (97-97) that is outside of the codespace
warning: ignoring CMap range (101-101) that is outside of the codespace
warning: ignoring CMap range (32-32) that is outside of the codespace
warning: ignoring CMap range (49-49) that is outside of the codespace

<goes on like this>

But the extraction works well, I want to suppress these warnings. These get printed even though I do not print them in my application

These get generated when I try to read the document:

// Extract the HTML from the first page
html, err := doc.HTML(0, false) // gets printed when this line executes
if err != nil {
	return "", fmt.Errorf("failed to extract HTML: %v", err)
}

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