Drawings extraction from PDF #1577
Replies: 6 comments 17 replies
-
There is no general recipe for doing this. |
Beta Was this translation helpful? Give feedback.
-
As I wrote: it does not make sense to back-compute coordinates starting from the |
Beta Was this translation helpful? Give feedback.
-
I have tried extracting all the rect values of drawings present on one page and identified one drawing of interest in the stream but could not identify any re value of the specific drawing in the stream. Can you let me know how page.get_drawings() gives rect values when the drawing in the content stream does not have re operator. |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
Coordinates in the PDF follow the PDF scheme. If you output stuff with PyMuPDF you must use MuPDF's addressing scheme. For translating PDF (e.g. |
Beta Was this translation helpful? Give feedback.
-
Can you do me - and all the other readers - a favor and start a new discussion for questions that do not fall under the title of this one? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to extract the rect values of specific drawings from PDF.
For example, in the following PDF, I just want to extract rect values of the tick marks present on the first page. Can you please let me know how this can be achieved.
EPack1.pdf
I have tried extracting drawings using the following code I have got all the drawings present on that page. Attaching the output PDF.
drawings-page-0.pdf
page = doc[0]
paths = page.get_drawings()
for path in paths:
------------------------------------
draw each entry of the 'items' list
------------------------------------
------------------------------------------------------
all items are drawn, now apply the common properties
to finish the path
------------------------------------------------------
shape.commit()
outpdf.save("drawings-page-0.pdf")
Beta Was this translation helpful? Give feedback.
All reactions