ElseIf e.nEventID = nIDS(CInt(IDS.e_document_afterChangePagesList)) Then
Dim nID As Integer = Me.docPreview.Inst.Str2ID("op.annots.setProps", False)
Dim Op As PDFXEdit.IOperation = Me.docPreview.Inst.CreateOp(nID)
Dim inputProps As PDFXEdit.ICabNode = Op.Params.Root("Input")
For i As UInteger = 0 To Me.docPreview.Doc.CoreDoc.Pages.Count - 1
Dim page As PDFXEdit.IPXC_Page = Me.docPreview.Doc.CoreDoc.Pages(i)
Dim nCnt As UInteger = page.GetAnnotsCount()
If nCnt <> 0 Then
For j As UInteger = 0 To nCnt - 1
Dim annot As PDFXEdit.IPXC_Annotation = page.GetAnnot(j)
If annot.IsMarkup Then
Dim annotType As String = pxsInst.AtomToStr(annot.Type)
If annotType = "FreeText" Then
Dim mData As PDFXEdit.IPXC_AnnotData_FreeText = CType(annot.Data, PDFXEdit.IPXC_AnnotData_FreeText)
Dim color As PDFXEdit.IColor = auxInst.CreateColor(PDFXEdit.ColorType.ColorType_RGB)
color.Value = "rgbd(128,128,128)"
mData.DefaultTextColor = color
annot.Data = mData
inputProps.Add().v = annot
Dim options As PDFXEdit.ICabNode = Op.Params.Root("Options")
options("Flags").v = PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_Text
options("Mask").v = PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_Flags
Sorry to bother you as I know I only posted this yesterday, but this is the last thing I need to resolve prior to releasing my new version of software, if you have time could you have a look at the for me.
From what I see, if you modify the color of the annotation's text, the RichText value is being set to the proper formatting. You can get the plain text out of the annotation and turn it into your own formatting via the RichText value, though if there were any other setting like font size or different styles - all of them will be rewritten by your new style.
Basically, the string itself would look something like this:
Thank you for the info, however I do not want to change the formatting etc if the text. I have just had a play around with your text commandbar and this allows you to change the font colour and does not override the formatting. Would it be possible for the developers to make available the method that the change font colourpicker is using as this seems to do the job?
1. How do I set the new richtext back to the annotation element?