Skip to content

pdf-parser: Store Name as Vec<u8> and skip comments in arrays/dicts#90

Merged
Velli20 merged 1 commit intomainfrom
parser-fixes-4
Feb 17, 2026
Merged

pdf-parser: Store Name as Vec<u8> and skip comments in arrays/dicts#90
Velli20 merged 1 commit intomainfrom
parser-fixes-4

Conversation

@Velli20
Copy link
Owner

@Velli20 Velli20 commented Feb 17, 2026

Change ObjectVariant::Name from String to Vec to preserve raw bytes and avoid lossy Latin-1 interpretation of #HH hex escapes. Dictionary keys are converted to String at the parsing boundary since PDF spec requires them to be ASCII.

Replace skip_whitespace() with skip_whitespace_and_comments() in array and dictionary parsers so that PDF comments between elements are properly consumed instead of causing parse errors.

Change ObjectVariant::Name from String to Vec<u8> to preserve raw bytes
and avoid lossy Latin-1 interpretation of #HH hex escapes. Dictionary
keys are converted to String at the parsing boundary since PDF spec
requires them to be ASCII.

Replace skip_whitespace() with skip_whitespace_and_comments() in array
and dictionary parsers so that PDF comments between elements are properly
consumed instead of causing parse errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Velli20 Velli20 merged commit 4d281f3 into main Feb 17, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant