A form that converted to three hundred bytes now converts to eight thousand - #6
Merged
Conversation
…ght thousand extract v0.3.0 reads a symbolic TrueType font through its own character map. A font flagged symbolic with an embedded FontFile2 and neither /Encoding nor /ToUnicode used to yield no text at all, so a document set in one converted to a heading and nothing else. Four US Department of Labor forms from 1999, converted to LaTeX: 1999-schedule-i 296 bytes, 16 words -> 8 565 bytes, 1 955 words 1999-5500-schedule-a 354 bytes, 32 words -> 10 550 bytes, 2 605 words 1999-schedule-d 325 bytes, 24 words -> 4 972 bytes, 540 words 1999-schedule-g 354 bytes, 32 words -> 6 466 bytes, 825 words Reading the page rather than the file: schedule I gave "2 0 9 9 0 0 0 1 1 M" and now gives "SCHEDULE I Financial Information -- Small Plan Official Use Only / (Form 5500) OMB No. 1210-0110 ...", which is 1 103 words against pdftotext's 1 105 on the same page. The two words are the price of being stricter than the reference. Neither poppler nor pdf.js consults the character map for text — both default such a font to WinAnsiEncoding names and hope — while this reports the character of the glyph that actually gets drawn, and stays silent where the font gives it no honest answer. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
extract v0.3.0 reads a symbolic TrueType font through its own character map. A
font flagged symbolic with an embedded FontFile2 and neither /Encoding nor
/ToUnicode used to yield no text at all, so a document set in one converted to
a heading and nothing else.
Four US Department of Labor forms from 1999, converted to LaTeX:
1999-schedule-i 296 bytes, 16 words -> 8 565 bytes, 1 955 words
1999-5500-schedule-a 354 bytes, 32 words -> 10 550 bytes, 2 605 words
1999-schedule-d 325 bytes, 24 words -> 4 972 bytes, 540 words
1999-schedule-g 354 bytes, 32 words -> 6 466 bytes, 825 words
Reading the page rather than the file: schedule I gave "2 0 9 9 0 0 0 1 1 M"
and now gives "SCHEDULE I Financial Information -- Small Plan Official Use
Only / (Form 5500) OMB No. 1210-0110 ...", which is 1 103 words against
pdftotext's 1 105 on the same page.
The two words are the price of being stricter than the reference. Neither
poppler nor pdf.js consults the character map for text — both default such a
font to WinAnsiEncoding names and hope — while this reports the character of
the glyph that actually gets drawn, and stays silent where the font gives it no
honest answer.