Var pdf As New PDFDocument
Var g As Graphics = pdf.Graphics
g.PenSize = 1
g.DrawLine(0, 50, g.width, 50)
g.drawline(50,0,50,g.height)
pdf.AddAnnotation("anno1",50,50)
//
g.DrawLine(0, 100, g.width, 100)
pdf.AddLinkArea("https://www.google.com",50,100,100,50)
Var f As FolderItem = SpecialFolder.Desktop.Child("Barchart.pdf")
pdf.Save(f)
Anyone know whats wrong?
The Text annotation appears as a small yellow box with NO TEXT (ie…‘anno1’)
the LINK annotation “works” but is invisible
I draw the lines to show where the upper left corner of each annotation should be
PDFDocument.AddLinkArea only defines the link and the “area”. This makes it possible to use all shapes you like to use for a link (text, rectangles, ovals etc.). PDFDocument.AddAnnotation is quite the same. You can set the x/y position to any point on your current page.
g.DrawRectangle(50, 100, 100, 50)
' Add annotation next to the rectangle
pdf.AddAnnotation("anno1", 50, 50)
' Click the rectangle to go to www.google.com
pdf.AddLinkArea("https://www.google.com", 50, 100, 100, 50)