VB.Net, Specifying Parameters for AcroExch.PDPage/etc...
The end goal: Programmatically add annotations to a PDF through a VB.Net Windows Form Document.
The Issue: Using the AddAnnot() jsObj situation.
Where I'm stuck:
I've found some great Adobe references that seemed very promising and have answered some other questions. My issue is that in the "Javascript for Acrobat API Reference" the Parameters for the AddAnnot() function (I think that function is the right word) are not as explicit as others. For example, the addWaterMarkFromFile() reference lists 16 parameters, each with a name, what they're specifying, and their default values. In the SDK reference for the addWaterMarkFromFile() there are 16 parameters specified, and they can be manipulated in a sensible enough manner. The example:
However, with the AddAnnot() reference the only parameter listed is an "object literal", which is described as containing the properties of the Annotation object.
I've found the list of the properties, and with what syntax can I specify some of all of them? The reference shows them specifed as follows:
var sqannot = this.addAnnot({type: "Square", page: 0});
or
var annot = this.addAnnot
({
page: 0,
type: "Text",
author: "A. C. Robat",
point: [300,400],
strokeColor: color.yellow,
contents: "Need a little help with this paragraph.",
noteIcon: "Help"
});
My rationale (which is incorrect) suggests that I could call the second example by:
Dim srcPage As Acrobat.CAcroPDPage
srcPage = CreateObject("AcroExch.PDPage")
jsStampObj = srcDoc.GetJSObject
jsStampObj.AddAnnot(0, "Text", "A. C. Robat", New Point(300,400), jsStampObj.Color.Blue, "Need a little help with this paragraph", "Help")
But I'm unsure if the above is even remotely correct either, as I haven't specified any page to which the annotation should be added. My efforts thus far have been to shove that code into the loop the WaterMarkJsoVB() project from the SDK uses to place watermarks. The addWaterMarkfromFile has a parameter for the document to which it should be pointing and the page on which ti place the mark, I've seen no such parameter in any reference relating to Add Annot. Still unsure how to point at pages too well, and have only had success with PDDoc objects and splitting pages / creating new pdfs, straight from the SDK.
I digress! Any input?
