Skip to content

get_drawings() can't detect line #926

Discussion options

You must be logged in to vote

For reasons which remain his secret, the PDF creator decided to draw thin horizontal bars, instead of lines.
You can easily find out yourself:

  • If a path (an item of the list page.get_drawings()) is a rectangle, then there is only one item in path["items"], which then looks like ("re", fitz.Rect(...)).
  • In contrast, a path can have multiple lines and curves in its path["items"].
  • For all paths, there is the key/value path["rect"] which is the rectangle envelopping the complete drawing, which this path represents.
  • You can check the rectangle height as usual: path["rect"].height - it is a fitz.Rect.
  • So my suggestion would be to treat rectangles like lines, if they obey certain criteria (pleas…

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@JorjMcKie
Comment options

@HeroadZ
Comment options

@JorjMcKie
Comment options

@HeroadZ
Comment options

@JorjMcKie
Comment options

Answer selected by JorjMcKie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #925 on March 01, 2021 12:24.