Loop through just imported annotations...

PDF-XChange Editor SDK for Developers

Moderators: Tracker Support, TrackerSupp-Daniel, Paul - Tracker Supp, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Tracker Supp-Stefan, Ivan - Tracker Software

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: 406
Joined: Sat May 16, 2009 1:55 pm

Loop through just imported annotations...

Post by lidds » Thu Jan 04, 2018 9:04 am

What I want to do is just be able to loop through the annotation items that are imported. I am capturing the op.document.importCommentsAndFields, however I am not sure how to just loop through the annotation elements being imported?

Obviously the below code loops through all annotations on the document, NOT just the ones being imported.

Code: Select all

                ElseIf oper.ID = Me.docPreview.Inst.Str2ID("op.document.importCommentsAndFields", False) Then
                    Dim nID As Integer = Me.docPreview.Inst.Str2ID("op.annots.delete", False)
                    Dim Op As PDFXEdit.IOperation = Me.docPreview.Inst.CreateOp(nID)

                    Dim annotsList As PDFXEdit.IPXV_AnnotsList = pxvInst.CreateAnnotsList()
                    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()
                        For j As UInteger = 0 To nCnt - 1
                            Dim annot As PDFXEdit.IPXC_Annotation = page.GetAnnot(j)

                            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)

                                Console.WriteLine("username: " + mData.Title)
                                Console.WriteLine("department: " + mData.Subject)

                            End If
                        Next
                    Next
Thanks

Simon

User avatar
Sasha - Tracker Dev Team
User
Posts: 4076
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Loop through just imported annotations...

Post by Sasha - Tracker Dev Team » Thu Jan 04, 2018 10:03 am

Hello Simon,

You can get the information from the SrcFile in the Operation's options:
https://sdkhelp.tracker-software.com/vi ... ds_Options

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

lidds
User
Posts: 406
Joined: Sat May 16, 2009 1:55 pm

Re: Loop through just imported annotations...

Post by lidds » Mon Jun 03, 2019 1:44 pm

Alex,

I have looked at the link provided and am unable to determine how I can get the annot element of just the imported file. Is it possible for you give me a code snippet, I have got pretty good with the SDK, but can't figure this one out.

Thanks for your help

Simon

User avatar
Sasha - Tracker Dev Team
User
Posts: 4076
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Loop through just imported annotations...

Post by Sasha - Tracker Dev Team » Mon Jun 03, 2019 2:39 pm

Hello Simon,

Sorry, I've misread your question. I think you have found a solution to this one earlier:
viewtopic.php?f=66&t=30017&p=118608&hil ... ds#p118622

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply