prevent annot box

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Chris - Tracker Supp, 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
jusWest
User
Posts: 80
Joined: Fri Aug 24, 2018 8:26 am

prevent annot box

Post by jusWest » Tue Sep 18, 2018 10:17 am

Hello!

Is there a way, event or otherwise, to disable the opening of a annotation window when we use the "cmd.tool.annot.highlight" tool?

Which event needs to be used to prevent this?

Tried this:

Code: Select all

            
            else if (e.nEventID == nIDS[(int)IDS.e_annots_inserted])
            {
               e.pEvent.Handled = true;
               e.pEvent.Result = 1;
            }
But it did not work

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

Re: prevent annot box

Post by Sasha - Tracker Dev Team » Tue Sep 18, 2018 11:29 am

Hello jusWest,

Well, you can disable the command itself by using the IUIX_CmdManager that you can get from the IUIX_Inst:
https://sdkhelp.tracker-software.com/vi ... CmdManager
Or you can catch the https://sdkhelp.tracker-software.com/vi ... oreExecute operation, check if it's an op.annots.addNew operation and then break it if it's the input has IPXC_Annotation of the Highlight type.

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

jusWest
User
Posts: 80
Joined: Fri Aug 24, 2018 8:26 am

Re: prevent annot box

Post by jusWest » Tue Sep 18, 2018 12:14 pm

Thanks!

If i do this:

Code: Select all


            if (e.nEventID == nIDS[(int)IDS.e_operBeforeExecute])
            {
                IOperation oper = (IOperation)e.pFrom;
                opModifyFields = pdfCtl.Inst.Str2ID("op.annots.addNew", false);
                if (opModifyFields == oper.ID)
                {
                    e.pEvent.Handled = true;
                    e.pEvent.Result = 1;
                }

            }
It also disables the higlighting of the text in the pdf document, but i only want to prevent the double click on the highlightet text so that we do not get this window:
Attachments
annot.PNG
annot.PNG (8.33 KiB) Viewed 838 times

jusWest
User
Posts: 80
Joined: Fri Aug 24, 2018 8:26 am

Re: prevent annot box

Post by jusWest » Wed Sep 19, 2018 6:52 am

Anything I can do to just disable the opening of the higlight editor window, and still be able to highlight text in the document?

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

Re: prevent annot box

Post by Sasha - Tracker Dev Team » Wed Sep 19, 2018 9:16 am

Hello jusWest,

That is called the popup note - I thought you needed to disable the highlight itself.
In this case, you will have to check two operations - add annotation and modify annotation. If first case, you will have to check the operation input for the StrToAtom("Popup") typed annotations and break if such are in the input. In the second case, the modify annotations operation will have a OpModifyAnnot_Opened flag in it's "Mask" option and the "Opened" will be set to true. In this case, you will also have to break.

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

jusWest
User
Posts: 80
Joined: Fri Aug 24, 2018 8:26 am

Re: prevent annot box

Post by jusWest » Thu Sep 20, 2018 12:19 pm

thanks, the terminilogy is sometimes lost on me :O, that is also why it is somethimes difficult to get hits on search, because I use the wrong word for things...

I can catch the addnew operation in the e_operBeforeExecute event,
but after that I'm not sure how to do what you describe in you latest reply.

Can you help?

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

Re: prevent annot box

Post by Sasha - Tracker Dev Team » Thu Sep 20, 2018 12:50 pm

Hello justWest,

You will have to extract the input from it. For that, you will have to get the "Input" CabNode (https://sdkhelp.tracker-software.com/vi ... ots_addNew) and then (as it's an array) get every element and cast it to the IPXC_Annotation interface:

Code: Select all

PDFXEdit.ICabNode input = oper.Params.Root["Input"];
PDFXEdit.IPXC_Annotation annot = input[0].v as PDFXEdit.IPXC_Annotation;
Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply