How do I get the stamp annotation after using Stamper::SetAsAnnotation(true)?

59 views
Skip to first unread message

Ryan

unread,
Sep 19, 2013, 8:14:35 PM9/19/13
to pdfne...@googlegroups.com
Q.
When I stamp an annotation, using the Stamper class, how can I get the actual annotation?

For example?
s = Stamper(Stamper.e_relative_scale, 0.25, 0.25)
img
= Image.Create(doc.GetSDFDoc(), input_path + "peppers.jpg")
s
.SetAlignment(Stamper.e_horizontal_center, Stamper.e_vertical_center)
pt
= ColorPt(0, 0, 0, 0)
s
.SetAsAnnotation(True)
ps
= PageSet(1)
s
.StampImage(doc, img, ps)

# get annotation?

------------------
A.
Annotations are always added to the end of the list of existing annotations for a page. So calling the following code immediately after stamping, will give you the annotation created by the Stamper class.

stamp_annot = page.GetAnnot( page.GetNumAnnots() -1 );



Reply all
Reply to author
Forward
0 new messages