Create annotations
A variety of annotations can be created such as sticky note (text annotations), link annotations, stamp annotations, and more.
Add text annotation to a PDF on iOS
To add a sticky note (text annotation) to a PDF Document.
PTPDFDoc *doc = [[PTPDFDoc alloc] initWithFilepath:filename];
PTPage *page = [doc GetPage:1];
// Create the sticky note (Text annotation)
PTText *txt =
[PTText Create:[doc GetSDFDoc]
pos:[[PTPDFRect alloc] initWithX1:10 y1:20 x2:30 y2:40]];
[txt SetTextIconName:@"UserIcon"];
[txt SetContents:@"The quick brown fox ate the lazy mouse."];
[txt SetColor:[[PTColorPt alloc] initWithX:0 y:1 z:0 w:0] numcomp:3];
[txt RefreshAppearance];
[page AnnotPushBack:txt];let doc: PTPDFDoc = PTPDFDoc(filepath: filename)
let page: PTPage = doc.getPage(1)
// Create the sticky note (Text annotation)
let txt: PTText = PTText.create(doc.getSDFDoc(), pos: PTPDFRect(x1: 10, y1: 20, x2: 30, y2: 40))
txt.setTextIconName("UserIcon")
txt.setContents("The quick brown fox ate the lazy mouse.")
txt.setColor(PTColorPt(x: 0, y: 1, z: 0, w: 0), numcomp: 3)
txt.refreshAppearance()
page.annotPushBack(txt)Add or edit PDF annotations Full code sample which shows how to add or edit PDF annotations (e.g. hyperlink, intra-document link, stamp, rubber stamp, file attachment, sound, text, free-text, line, circle, square, polygon, polyline, highlight, squiggly, caret, and ink).
Create link annotation to a PDF on iOS
To add a hyperlink or intra-document link annotation to a PDF Document page.
PTPDFDoc *doc = [[PTPDFDoc alloc] initWithFilepath: filename];
PTPage *page = [doc GetPage:1];
// Create a hyperlink
PTLink *hyperlink = [PTLink CreateWithAction: [doc GetSDFDoc] pos: [[PTPDFRect alloc] initWithX1: 85 y1: 570 x2: 503 y2: 524] action: [PTAction CreateURI: [doc GetSDFDoc] uri: @"http://www.apryse.com"]];
[hyperlink RefreshAppearance];
[page AnnotPushBack: hyperlink];
// Create an intra-document link
PTAction *goto_page_3 = [PTAction CreateGoto: [PTDestination CreateFitH: [doc GetPage:3] top: 0]];
PTLink *link = [PTLink CreateWithAction: [doc GetSDFDoc] pos: [[PTPDFRect alloc] initWithX1: 85 y1: 458 x2: 503 y2: 502] action: goto_page_3];
[link RefreshAppearance];
[page AnnotPushBack: link];let doc: PTPDFDoc = PTPDFDoc(filepath: filename)
let page: PTPage = doc.getPage(1)
// Create a hyperlink
let hyperlink = PTLink.create(withAction: doc.getSDFDoc(), pos: PTPDFRect(x1: 85, y1: 570, x2: 503, y2: 524), action: PTAction.createURI(doc.getSDFDoc(), uri: "http://www.apryse.com"))
hyperlink.refreshAppearance()
page.annotPushBack(hyperlink)
// Create an intra-document link
let goto_page_3 = PTAction.createGoto(PTDestination.createFitH(doc.getPage(3), top: 0))
let link: PTLink = PTLink.create(withAction: doc.getSDFDoc(), pos: PTPDFRect(x1: 85, y1: 458, x2: 503, y2: 502), action: goto_page_3)
link.refreshAppearance()
page.annotPushBack(link)Add or edit PDF annotations sample Full code sample which shows how to add or edit PDF annotations (e.g. hyperlink, intra-document link, stamp, rubber stamp, file attachment, sound, text, free-text, line, circle, square, polygon, polyline, highlight, squiggly, caret, and ink).
Add a stamp annotation to a PDF on iOS
A stamp in a PDF document is analogous to applying a rubber stamp on a paper document.
Apryse SDK benefits include:
Stamp PDF pages with text, images, or with other PDF pages.
Embed fonts and images, and copy graphical elements from one page to another.
Use Stamper to stamp content (text, image, PDF page)
To stamp text, image, and a PDF page to a PDF document.
Stamp a PDF File Full code sample which shows how to stamp PDF pages with text, images, or with other PDF pages and how to add new content (or watermark).
About Stamper
Stamper can be used for PDF pages with text, images, or with other PDF content in only a few lines of code. Although Stamper is very simple to use compared to ElementBuilder/ElementWriter it is not as powerful or flexible. In case you need full control over PDF creation use ElementBuilder/ElementWriter to add new content to existing PDF pages as shown in the ElementBuilder sample project .
Add highlight annotation to a PDF on iOS
To add a highlight annotation to a PDF Document page.
Add or edit PDF annotations sample Full code sample which shows how to add or edit PDF annotations (e.g. hyperlink, intra-document link, stamp, rubber stamp, file attachment, sound, text, free-text, line, circle, square, polygon, polyline, highlight, squiggly, caret, and ink).
Add free text annotation to a PDF on iOS
To add a free text annotation to a PDF Document page.
Add or edit PDF annotations sample Full code sample which shows how to add or edit PDF annotations (e.g. hyperlink, intra-document link, stamp, rubber stamp, file attachment, sound, text, free-text, line, circle, square, polygon, polyline, free text, squiggly, caret, and ink).
Add rectangle annotation to a PDF on iOS
To add a rectangle annotation to a PDF Document page.
Add or edit PDF annotations sample Full code sample which shows how to add or edit PDF annotations (e.g. hyperlink, intra-document link, stamp, rubber stamp, file attachment, sound, text, free-text, line, circle, square, polygon, polyline, rectangle, squiggly, caret, and ink).
Last updated
Was this helpful?