You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
elements = [element for element in page if isinstance(element, LTTextContainer)]
however, I have an example PDF (which I can't share) where one of these elements is an LTTextLine.
LTTextBox and LTTextLine are both LTTextContainers.
We're expecting to get LTTextBoxes, containing LTTextLines, which in turn contain LTChars. In this case, we're only getting an LTTextLine containing an LTChar. This breaks the code, for example when trying to find the font, since we try to iterate through the 2nd level, which should be an LTTextLine, but is now an LTChar which is not iterable.
I think the fix here is to search for instances of LTTextBox instead of LTTextLine.
The text was updated successfully, but these errors were encountered:
In the loaders, we do
however, I have an example PDF (which I can't share) where one of these elements is an
LTTextLine
.LTTextBox
andLTTextLine
are bothLTTextContainer
s.We're expecting to get
LTTextBox
es, containingLTTextLine
s, which in turn containLTChar
s. In this case, we're only getting anLTTextLine
containing anLTChar
. This breaks the code, for example when trying to find the font, since we try to iterate through the 2nd level, which should be anLTTextLine
, but is now anLTChar
which is not iterable.I think the fix here is to search for instances of
LTTextBox
instead ofLTTextLine
.The text was updated successfully, but these errors were encountered: