How to extract an annotation appearance to an image file

158 views
Skip to first unread message

Anderson Konzen

unread,
Aug 20, 2013, 4:12:15 PM8/20/13
to pdfne...@googlegroups.com
Q: How can I extract an annotation appearance to an image file? For example, I have an ink annotation I would like to save as a jpg.

-----

A: One way to achieve that is to use PDFDraw. Once you get the annotation object (either by traversing the document - http://www.pdftron.com/pdfnet/samplecode.html#Annotation - or by other means) you can:

Page tempPage = doc.pageCreate();
tempPage.annotPushBack(annot);
tempPage.setMediaBox(annot.getRect());
PDFDraw pdfDraw = new PDFDraw();
pdfDraw.export(tempPage, "/mnt/sdcard/annot.jpg", "JPEG");


If you are working with stamp annotations, you might also want to check this post: https://groups.google.com/d/msg/pdfnet-sdk/3o_dQ89Kpu8/bwSxIGjf8k8J
Reply all
Reply to author
Forward
0 new messages