Check to see if annot is locked

PDF-XChange Editor SDK for Developers

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.
Post Reply
lidds
User
Posts: 510
Joined: Sat May 16, 2009 1:55 pm

Check to see if annot is locked

Post by lidds »

I need to see if selected annotation elements are locked. Below is the code so far, however this is not working as the annotation element has a flag value of 644, which obviously is a number of flags that I have set on the annotation element previous. Is there a way to just check if it's locked:

Code: Select all

        Dim sel As PDFXEdit.IPXV_DocSelection = Me.docPreview.Doc.ActiveSel
        Dim annotSel As PDFXEdit.IPXV_AnnotSelection = CType(sel, PDFXEdit.IPXV_AnnotSelection)
        Dim annotType As String = Nothing
		
        If annotSel IsNot Nothing Then
            If annotSel.Items.Count <> 0 Then
                Dim ipi As IPXV_InvalidatePagesInfo = docPreview.Doc.CreateInvPagesInfo()
                For i As UInteger = 0 To annotSel.Items.Count - 1
                    Dim annot As IPXC_Annotation = annotSel.Items(i)
                    annotType = pxsInst.AtomToStr(annot.Type)

                    If annot.Flags = PXC_AnnotFlag.AF_ContentLocked Then
                        Debug.WriteLine("Annot locked")
                    End If
                Next
            End If
        End If
Thanks Simon
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Check to see if annot is locked

Post by Sasha - Tracker Dev Team »

Hello Simon,

Well, the flags are flags - not a direct values - bit vise operations should be used to get the needed flag value.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply