copy graphic elements but not text #2640
-
I'd like to to copy the graphic elements of a pdf page by page (let's say a banner or background image etc), but without the text. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is possible - at least mostly.
If it is a drawing (vector graphics), things are more difficult. You first must find a way to identify the object. It will generally be a sublist of If it is text, then things are similar as with vector graphics. |
Beta Was this translation helpful? Give feedback.
This is possible - at least mostly.
If the desired object is an image, this is particularly easy:
page.insert_image(bbox, xref=xref, overlay=False)
If it is a drawing (vector graphics), things are more difficult. You first must find a way to identify the object. It will generally be a sublist of
page.get_drawings()
. Once identified, just re-execute the draw commands contained in the sublist of paths.If it is text, then things are similar as with vector graphics.
So much for now ...