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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Add "layout" mode for text extraction #2388
ENH: Add "layout" mode for text extraction #2388
Changes from 12 commits
86ed974
f43b84e
220de15
21d9f1b
9fa3b5f
1545a27
81b6a83
bb9190b
cefbfc6
ff7e40f
f37909c
48e971e
8742bcc
8e9d879
4dc3250
d1d85a0
70b2f31
e7d5edd
64d1df0
377bbd1
3a0fc89
fe7bb69
cec0be3
955bd38
579692a
4402caa
41417eb
778f3c7
8279c79
75aec12
f25e9d5
744a6db
c5f0cd8
1b65085
373025d
cdaa9ca
64e4c83
878e407
e9962b3
06e79d3
f43201a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 1891 in pypdf/_page.py
Codecov / codecov/patch
pypdf/_page.py#L1891
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me fonts are only returning DictionaryObject (most of the time through IndirectObject) in such case get_object() will always return the actual object. It seems also consistant with further use where I can not find ArrayObjects
in such case I would propose:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the nasty comprehension seems to be necessary. Here's an example of a PDF that requires the alternate ArrayObject interpretation.
Epic Page.PDF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shartzog
I'm sorry, I do not see the issue:
returns:
/F0 <class 'pypdf.generic._base.IndirectObject'> <class 'pypdf.generic._data_structures.DictionaryObject'>
/F1 <class 'pypdf.generic._base.IndirectObject'> <class 'pypdf.generic._data_structures.DictionaryObject'>
/F2 <class 'pypdf.generic._base.IndirectObject'> <class 'pypdf.generic._data_structures.DictionaryObject'>
/F3 <class 'pypdf.generic._base.IndirectObject'> <class 'pypdf.generic._data_structures.DictionaryObject'>
/F4 <class 'pypdf.generic._base.IndirectObject'> <class 'pypdf.generic._data_structures.DictionaryObject'>
/F5 <class 'pypdf.generic._base.IndirectObject'> <class 'pypdf.generic._data_structures.DictionaryObject'>
/F6 <class 'pypdf.generic._base.IndirectObject'> <class 'pypdf.generic._data_structures.DictionaryObject'>
/F7 <class 'pypdf.generic._base.IndirectObject'> <class 'pypdf.generic._data_structures.DictionaryObject'>
/F8 <class 'pypdf.generic._base.IndirectObject'> <class 'pypdf.generic._data_structures.DictionaryObject'>
/F9 <class 'pypdf.generic._base.IndirectObject'> <class 'pypdf.generic._data_structures.DictionaryObject'>
I can not see the arrayobject 😐. Can you help me find the hickup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh... I added a temporary print wrapper like so and got output from it...
Maybe I need to retest with the latest main??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let you know how further testing turns out. 👍
Check warning on line 1950 in pypdf/_page.py
Codecov / codecov/patch
pypdf/_page.py#L1950
Check warning on line 2027 in pypdf/_page.py
Codecov / codecov/patch
pypdf/_page.py#L2027