Skip to content

[Bug]: Indirect object reference in LastChar #243

@szepeviktor

Description

@szepeviktor

Is there an existing issue for this?

  • I have searched the existing issues and found no similar reports

Are you using the latest version of this package?

  • The issue I'm reporting exists in the latest release

Can other PDF readers read the file?

  • The PDF I'm trying to read opens correctly in at least one other PDF reader

When running this snippet

$document = (new PdfParser())->parseFile('/path/to/file.pdf');

I run into the following issue/exception (Please attach the pdf)

Value "91 0 R" for dictionary key LastChar could not be parsed to a valid value type

What it is: The error points to a Font dictionary entry. /LastChar must be an integer. Here it is 91 0 R, an indirect object reference, which the parser can’t turn into a valid integer.

Role: Together with /FirstChar, /LastChar defines the character-code range covered by /Widths for simple fonts (Type1/TrueType). Not used for CID/Type 0 fonts.

Where to find it: In a font object under a page’s /Resources → /Font.

Why it fails: The library expects a number, not a reference - or the referenced object isn't a number.

Do you allow attachment files to be used in tests to prevent regressions?

  • Yes, I give permission to use this file as a test file to prevent future regressions (And am authorized to give this permission)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions