prevent annot box

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
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

prevent annot box

Post by jusWest »

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
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: prevent annot box

Post by Sasha - Tracker Dev Team »

Hello jusWest,

Well, you can disable the command itself by using the IUIX_CmdManager that you can get from the IUIX_Inst:
https://sdkhelp.pdf-xchange.com/vi ... CmdManager
Or you can catch the https://sdkhelp.pdf-xchange.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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: prevent annot box

Post by jusWest »

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 1924 times
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: prevent annot box

Post by jusWest »

Anything I can do to just disable the opening of the higlight editor window, and still be able to highlight text in the document?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: prevent annot box

Post by Sasha - Tracker Dev Team »

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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: prevent annot box

Post by jusWest »

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?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: prevent annot box

Post by Sasha - Tracker Dev Team »

Hello justWest,

You will have to extract the input from it. For that, you will have to get the "Input" CabNode (https://sdkhelp.pdf-xchange.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
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply