Product: Android
Product Version: 9.3.1
Please give a brief summary of your issue:
Annotations merged using fdfMerge, using annotation manager to manage permissions. Our userId can change, so I need to know how to edit the userID
Please describe your issue and provide steps to reproduce it:
We are adding annotations after the file has been loaded, using the following code block:
annotations?.forEach { annotation ->
val fdfDoc = FDFDoc.createFromXFDF(annotation.xfdfString)
val pdfDoc = pdfViewCtrlTabHostFragment?.currentPdfViewCtrlFragment?.pdfDoc
try {
pdfDoc?.fdfMerge(fdfDoc)
} catch (e: PDFNetException) {
...
}
}
and adding the annotation manager to the fragment using the following code:
currentPdfViewCtrlFragment?.toolManager?.let { toolManager ->
val annotationBar = view?.findViewById<FrameLayout>(R.id.annotation_toolbar)
val vmProvider = ViewModelProvider(this)
val toolManagerVm: ToolManagerViewModel =
vmProvider[ToolManagerViewModel::class.java]
toolManager.enableAnnotManager(if (hasAnnotationPermission) userID else "-1")
toolManagerVm.toolManager = toolManager
The userId that we pass into the annotaitonManager can be edited separately from the pdftron experience. When we add the annotation (first block of code), we know the current userID and we know if the annotation belongs to the new userId. Ideally we would like to update the userId to the new one here while we are adding the annotations to the form. And then pass in the new userId to the annotation manager, and be done with it.
Could you help me find the best way to edit an annotation to update the userId when we just have it in xfdf form?
Thank you!