6 Replies Latest reply on Sep 17, 2016 8:21 PM by nurlybek

    How to use AP property of the stamp type annotation in javascript


      I have been trying to insert a stamp using the AddAnnot method and this is the code I have:


      Function Doug(FileName, path) As Long

      Dim Acroapp As Acrobat.Acroapp

      Dim Doc1 As Acrobat.AcroPDDoc

      Dim CodeBox As Acrobat.AcroPDAnnot

      Dim Page As Acrobat.AcroPDPage

      Dim Cod1 As Acrobat.AcroPDDoc

      Dim gap As Acrobat.AcroPDPage

      Dim annot As Object

      Dim prop As Object

      Dim jso As Object

      Dim arr(0 To 3) As Integer


      Set Acroapp = CreateObject("AcroExch.App")

      Set Doc1 = CreateObject("AcroExch.PDDoc")

      'Set Cod1 = CreateObject("AcroExch.PDDoc")

      arr(0) = 0

      arr(1) = 0

      arr(2) = 300

      arr(3) = 300


      If Doc1.Open(path & FileName) = True Then

      Set Page = Doc1.AcquirePage(0)

      Set jso = Doc1.GetJSObject

      If Not jso Is Nothing Then

           Set annot = jso.AddAnnot()

           Set prop = annot.GetProps

                prop.Type = "Stamp"

           annot.setprops prop


           Set prop = annot.GetProps

                prop.AP = "#kZBRdNJ8NdlGCzWSCKIn3A"

                prop.rect = arr

           annot.setprops prop


      End If


      Doc1.Save 1, path




      End If

      End Function


      It adds an annotation, but its just a box with no text in it. What am I doing wrong?