JSObject Doesn't Have Correct Commands
I have Adobe Acrobat Standard DC installed core version 18.2304. I'm using Visual Studio 2017 and using Visual Basic. I'm trying to create a code to mark a pdf drawing as a draft. I'm starting from the example on one of Adobe's iac developers's guide example thinking that would be a good place to start. I tried out the code that starts on page 23. It didn't work, and I've narrowed the problem to the JSObject. I can use methods from pdDoc to get the correct filename for the PDF, so I think all is working up to that point. The jso object also isn't nothing, so it enders the if statement, but the jso object doesn't have any of the methods used by the pdf example available, so it throws me an error when I try annot = jso.AddAnnot. I have the below references added to the project. Anyone have any idea what the issue might be? Thanks in advance for any help!
http://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/iac_developer_guide.pdf
Sub StampPDF(ByVal MyPDFPath As String)
Dim gApp As Acrobat.CAcroApp
gApp = CreateObject("AcroExch.App")
Dim pdDoc As Acrobat.CAcroPDDoc
pdDoc = CreateObject("AcroExch.PDDoc")
Dim pdAnnot As Acrobat.CAcroPDAnnot
pdAnnot = CreateObject("AcroExch.PDAnnot")
Dim PDFResult As Boolean
Dim page As Acrobat.CAcroPDPage
Dim jso As Object
Dim point(1) As Integer
Dim popupRect(3) As Integer
Dim pageRect As Object
Dim annot As Object
Dim props As Object
PDFResult = pdDoc.Open(MyPDFPath)
jso = pdDoc.GetJSObject
If Not jso Is Nothing Then
' Get size for page 0 and set up arrays
page = pdDoc.AcquirePage(0)
pageRect = page.GetSize
point(0) = 0
point(1) = pageRect.y
MsgBox(point(1))
popupRect(0) = 0
popupRect(1) = pageRect.y - 100
popupRect(2) = 200
popupRect(3) = pageRect.y
' Create a new text annot
' annot = jso.AddAnnot
' props = annot.getProps
' props.Type = "Text"
' 'annot.setProps props
' ' Fill in a few fields
' props = annot.getProps
' props.page = 0
' props.point = point
' props.popupRect = popupRect
' props.author = "John Doe"
' props.noteIcon = "Comment"
' props.strokeColor = jso.Color.red
' props.Contents = "I added this comment from Visual Basic!"
' 'annot.setProps props
End If
End Sub

