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.
I am running the below code to stop users modify annotation that is not placed by then. The problem is that once I change the annotation to be "Locked" it is no longer able to be printed.
Public Sub LockAnnotations(ByVal lockAll As Boolean, ByVal userOID As Guid)
Dim pSInt As PDFXEdit.IPXS_Inst = DirectCast(Me.docPreview.Inst.GetExtension("PXS"), PDFXEdit.IPXS_Inst)
Dim nID As Integer = Me.docPreview.Inst.Str2ID("op.annots.setProps", False)
Dim Op As PDFXEdit.IOperation = Me.docPreview.Inst.CreateOp(nID)
Dim input As PDFXEdit.ICabNode = Op.Params.Root("Input")
Dim page As PDFXEdit.IPXC_Page = Me.docPreview.Doc.CoreDoc.Pages(0)
Dim nPageCount As UInteger = page.GetAnnotsCount()
For i As UInteger = 0 To nPageCount - 1
Dim annot As PDFXEdit.IPXC_Annotation = page.GetAnnot(i)
If annot.IsMarkup Then
Dim data As PDFXEdit.IPXC_AnnotData = annot.Data
Dim mData As PDFXEdit.IPXC_AnnotData_Markup = DirectCast(data, PDFXEdit.IPXC_AnnotData_Markup)
' mData.Title is the username of who placed the annotation
If lockAll = False Then
If mData.Title.ToString.ToUpper <> userOID.ToString.ToUpper Then
input.Add().v = annot
End If
ElseIf lockAll = True Then
If MISData.Instance.ViewerMode = "Sign" Then
' If docdesigner is in Sign mode then we do not want to lock any signature stamps which are stored under the
' department "Signatures"
If mData.Subject <> "Signatures" Then
input.Add().v = annot
End If
Else
input.Add().v = annot
End If
End If
End If
Next
If input.Count = 0 Then
Return
End If
Dim options As PDFXEdit.ICabNode = Op.Params.Root("Options")
options("Flags").v = 128
options("Mask").v = 4194304
Op.Do()
End Sub
The description for the AF_ReadOnly flag is:
If set, the annotation will not interact with the user. The annotation may be displayed or printed (depending on the settings of the AF_NoView and AF_Print flags) but will not respond to mouse clicks or change its appearance in response to mouse motions. This flag ignored for widget annotations; its function is subsumed by the FF_ReadOnly flag of the associated form field.
So you need to also set the AF_Print one. Please try to have both flags on and see if it works?