6 Replies Latest reply on Dec 6, 2017 8:23 AM by Thom Parker

    Can I add rich text to a richtext-enabled FormField using VB?

    davec23933072

      I want to populate a richtext form field with a formatted string compiled by a vb.net app.

       

       

      Dim pdDoc As New Acrobat.AcroPDDoc

      pdDoc.Open("my.PDF")

      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?

       

      Had lots of experience setting value, font and sizes on fields - which I managed to decipher from "JavaScript for Acrobat  API Reference", but not this...

      The examples I've found all refer to Java - nothing for VB (or even C#, which might have helped).

       

      Any help much appreciated.

       

      Thanks

       

      Dave