I hate to admit I'm having a little difficulty with wrapping my head around annotations, or more specifically, stamps.
The specific problem I'm trying to solve involves a set of 3 special (read: custom) stamps. I am programmatically checking the AppData\Roaming\Tracker Software\Editor\3.0\Stamps folder and if the stamps are not there, I put the stamps in place so that they are always accessible in the editor. The problem is I would like to be able to do things like delete or flatten only these 3 stamps (not all stamps in a document) programmatically.
I have seen samples here on how to delete annotations of one specific type and I know for example how to flatten any annotation of type "Stamp". But traipsing around the Wiki and these forums, I haven't yet been able to figure out how handle and manipulate these specific 3 stamps which are part of a stamp collection called "Signatures". The stamps are called Red, Blue and Green, however, as far as I can tell, this is represented neither by annot.Title nor by annot.Name properties.
Banging my head doesn't seem to be producing any results. How can I go about programmatically detecting when any of these 3 specific stamps are added to the document, so that I can manipulate them accordingly. Any help/direction is greatly appreciated!
Edit: Also, I've since tried creating a stamp collection and using the AddStamp(s) methods to add the stamps manually, giving me more control over them since I know immediately how to identify them. I wasn't able to get this to work either, here is my code:
Code: Select all
Private Sub LoadStamps()
Dim xcInst As PDFXEdit.IPXC_Inst = DirectCast(pdfCtrl.Inst.GetExtension("PXC"), PDFXEdit.IPXC_Inst)
Dim StampMgr = xcInst.StampsManager
Dim MyNewCollection = StampMgr.CreateEmptyCollection("Signatures")
Dim name As PDFXEdit.IAFS_Name = fsInst.DefaultFileSys.StringToName(gAppDataPath & "\Tracker Software\PDFXEditor\3.0\Stamps\Signatures.pdf")
Dim file As PDFXEdit.IAFS_File = fsInst.DefaultFileSys.OpenFile(Name, CInt(PDFXEdit.AFS_OpenFileFlags.AFS_OpenFile_Read) Or CInt(PDFXEdit.AFS_OpenFileFlags.AFS_OpenFile_ShareRead))
Dim Stamp1 = MyNewCollection.AddStamp(file, "Red", 0)
Dim Stamp2 = MyNewCollection.AddStamp(file, "Blue", 1)
Dim Stamp3 = MyNewCollection.AddStamp(file, "Green", 2)
End SubThanks,
Doc.It Development