Add movable image annotation? #4357
-
Hi, I would like to add an image to a PDF in an annotation fashion. Freetext annots can be easily moved by the user in an appropriate PDF editor, but this cannot be used to add images. Images added through insert_image or insert_htmlbox cannot be moved unless the user edits the PDF in for instance Adobe Acrobat Pro. When I copy paste an image (screenshot for instance) on a PDF, I can still move it. It has the subtype "Square". I seem not be able to add such subtype to the pdf.
results in
Here, Another route I tried was So, is there a way to programmatically add a movable image to a PDF? Sample script:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
In the near future, we will support images as part of a "Stamp" annotation. It won't be part of the next version 1.25.5, but probably version 1.25.6. |
Beta Was this translation helpful? Give feedback.
-
It works! Thanks for the help
Op ma 10 mrt 2025, 14:00 schreef Jorj X. McKie ***@***.***>:
… Here you are.
stamp-image.zip
<https://github.com/user-attachments/files/19162739/stamp-image.zip>
The way it currently works is by creating an arbitrary text-based Stamp
annotation. Such annotations have a predefined width:height aspect ratio
(10:38 if I remember correctly).
Then convert this into an Image-Stamp. This will modify the original
annotation rectangle.
- The given rectangle is drawn in red.
- Standard (text) Stamp insertion behavior is to make a new annot
rectangle of required aspect ratio and put it centered into the given rect
(at max possible size).
- When converting to an image, the image is inserted at max possible
size, retaining image aspect ratio, such that its left border equals the
computed annot rectangle.
That's how far I am.
Opacity is supported by setting the annotation opacity.
Annotation rotation is *not* supported.
Let me know how this works for you.
—
Reply to this email directly, view it on GitHub
<#4357 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNSATQFOYVL6AC5SC24A432TWEGVAVCNFSM6AAAAABYVUA5TKVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENBUHA4TINA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
In the near future, we will support images as part of a "Stamp" annotation. It won't be part of the next version 1.25.5, but probably version 1.25.6.