Support for adding an image to a page? #2313
-
Does pypdf support adding an image to a page? I can find how to list existing images on a page and even to replace one but I can't seem to find a method to add a new image. I would be willing to contribute such a method if that would be welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Adding an image to a page can be done in 2 steps: Maybe an improvement could be to build the transformation matrix from the image size(from the pdf) the page size and destination position and size in percentage of destination page |
Beta Was this translation helpful? Give feedback.
By the way, the method mentioned by @pubpub-zz most likely is https://pypdf.readthedocs.io/en/stable/modules/PageObject.html#pypdf._page.PageObject.merge_transformed_page.