op.annots.move SDK Help sample -> "the parameter is incorrect"  SOLVED

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
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by zarkogajic »

Hi Support,

I'm trying to copy annotations from one core document to another. I'm trying with "op.annots.move".

I'm following the sample from https://sdkhelp.pdf-xchange.com/view/PXV:op_annots_move

On Op.Do() I'm getting "the parameter is incorrect" exception.

My code looks like:

Code: Select all

//both AnnotationFromSourceCoreDoc AND TARGETCoreDoc have a valid reference
int nID = Inst.Str2ID("op.annots.move", false);
PDFXEdit.IOperation Op = Inst.CreateOp(nID);
PDFXEdit.ICabNode input = Op.Params.Root["Input"];
input.Add().v = AnnotationFromSourceCoreDoc;
PDFXEdit.ICabNode options = Op.Params.Root["Options"];
options["NewDoc"].v = TARGETCoreDoc;
options["Copy"].v = true;
Op.Do(); //-> EXCEPTION HERE

p.s.
Btw, the "Doc" for "NewDoc" should be an IPXC_Document, not IPXV_Document as in that sample, correct?


-žarko
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by zarkogajic »

Support .... ?

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

Re: op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Hmm, I don't have any exceptions in the original sample, where the annots are being copied in the same document. Do you also have troubles with the original sample?
But I did recreate the behavior with other document as a NewDoc parameter.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Found the issue - the pages count in my destination document was less then the options["NewPageIndex"].v = 3;

After further inspection - it seems that copying annotations in other documents via this operation is not yet implemented. You can even try doing that in the End-User Editor - it won't work.
A TODO from our side.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by zarkogajic »

Hi Alex,

Thanks for the input.

Once implemented - will this operation allow copying annotations from one *core* document to another (so, not IPXV_Document)?

If "yes", why page-by-page as requested by the "Input" parameter (SDK Help: Note that all of the annotations must belong to one page in one document)?

-žarko
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by Tracker Supp-Stefan »

Hello zarkogajic,

Alex asked me to make a ticket in our internal system for this issue. The ticket number is
#5482: op.annots.move SDK Help sample -> "the parameter is incorrect"
and we will post again here as soon as there is any additional information in it.

Kind regards,
Stefan
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by zarkogajic »

:)

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

op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

We've made a fix for this one and it will be available from the 353 build that should be available in a week or so.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by zarkogajic »

Hi Alex,

What was actually fixed here?

I'm still getting the "The parameter is incorrect" if for the "NewDoc" entry I'm using a different Core Document.

p.s.
So, trying to copy annotations from one core document to another using "op.annots.move".

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

This works for me:
MoveAnnotsToAnotherDoc.zip
(2.38 KiB) Downloaded 53 times
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: op.annots.move SDK Help sample -> "the parameter is incorrect"

Post by zarkogajic »

Hi Alex,

Thanks.

The problem seems to be with the "NewPageIndex" parameter.

If I leave it as "-1" (default) then AV.

If I specify the page index - seems to work. :)

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

op.annots.move SDK Help sample -> "the parameter is incorrect"  SOLVED

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply