Moderators:TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
However what I want to do is also change the colour of the text on the annotation to grey, I therefore tried using the DefTextColor option, but this had no effect:
Let's try this. After you have executed the import annotations operation, the https://sdkhelp.pdf-xchange.com/vi ... ePagesList operation should be fired. You should catch it, and go though all of the FreeText annotations in the IPXC_Document and change their https://sdkhelp.pdf-xchange.com/vi ... tTextColor parameter. Then, the event should be caught by all of the other Views and they should load the style of the annotation with the changed text color.
ElseIf e.nEventID = nIDS(CInt(IDS.e_document_afterChangePagesList)) Then
Debug.WriteLine("e_document_afterChangePagesList")
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
End If
End If
Next
End If
Next
Dim options As PDFXEdit.ICabNode = Op.Params.Root("Options")
options("Flags").v = PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_Text
options("Mask").v = PXV_OpModifyAnnotMaskFlags.OpModifyAnnot_Flags
Op.Do()
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?
2. I am working with annotation export files and I have noticed that in the fdf file the tichtext is within this file. I was wondering if I can use javascript to return the current richtext of an annotation element and modify the colour and push it back?