I want to populate a richtext form field with a formatted string compiled by a vb.net app.
Dim pdDoc As New Acrobat.AcroPDDoc
Dim jso = pdDoc.GetJSObject
Dim myFld = jso.getField("MyFld")
Dim mySpans = myFld.richValue
Assuming that myField.value is "This is MY field", with "MY" in bold,
I get back 5 spans: "This is"," ","MY"," ","field", the fontWeight on all is 400 except for "MY" which is 700
I change mySpans(2).text from "MY" to "YOUR", and write the spans back:
myFld.richVale = mySpans
expecting to see "This is YOUR field", but I don't
Am I missing something here, or can I just not do it this way?
The examples I've found all refer to Java - nothing for VB (or even C#, which might have helped).
Any help much appreciated.
Is richVale a typo only in the post?
The solution to dealing with this issue is to develop a set of folder level functions that preform the heavy lifting on the JS side. Then call these functions from VB. This is also more efficient, because all the JS stuff is being done in the JS world
Another major advantage of this approach is that you can test your methodology for modifying rich text on Acrobat without the added complication of VB.
Suppose I need to get my head round Java then.