PDF-XChange Editor SDK for Developers
Moderators: PDF-XChange Support , Daniel - PDF-XChange , Chris - PDF-XChange , Sean - PDF-XChange , Paul - PDF-XChange , Vasyl - PDF-XChange , Ivan - Tracker Software , Stefan - PDF-XChange
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.
Artsiom
User
Posts: 14 Joined: Fri Aug 23, 2019 7:22 am
Post
by Artsiom » Tue Sep 03, 2019 5:53 pm
While switching from PDF Viewer to PDF Editor, I encountered the following problem:
I need to select annot by name.
My PDF Viewer method:
Code: Select all
public object SelectAnnot(string name)
{
var activeDocID = GetActiveDocument();
if (activeDocID < 0)
{
return null;
}
pdfViewerControl.DoVerb(activeDocID, null, "SelectAnnot", name, out var vDataOut);
return vDataOut;
}
How to do it in the Editor SDK?
Sorry for this simple question, but I could not find the necessary information on the forum
Regards,
Artsiom
Sasha - PDF-XChange
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - PDF-XChange » Wed Sep 04, 2019 6:41 am
Hello Artsiom,
Well I did find an answer on forums by first searching for Select word and then for Annot word - just like your topic name advises:
search.php?st=0&sk=t&sd=d&sr=posts&keyw ... d%5B%5D=66
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Artsiom
User
Posts: 14 Joined: Fri Aug 23, 2019 7:22 am
Post
by Artsiom » Wed Sep 04, 2019 7:27 am
I have a lot of annotations per one page, I need to choose by name . Can you share a link to solve the problem?
Regards,
Artsiom
Artsiom
User
Posts: 14 Joined: Fri Aug 23, 2019 7:22 am
Post
by Artsiom » Wed Sep 04, 2019 9:34 am
Thank you so much, Alex!
I can find my annotations by name now, but selection still doesn't work
Example:
Code: Select all
public void SelectAnnot(string name)
{
var annotList = new List<IPXC_Annotation>();
for (uint i = 0; i < pdfViewerControl.PagesCount; i++)
{
var page = pdfViewerControl.Doc.CoreDoc.Pages[i];
var annotCount = page.GetAnnotsCount();
for (uint j = 0; j < annotCount; j++)
{
var annot = page.GetAnnot(j);
annotList.Add(annot);
}
}
var requiredAnnot = annotList.FirstOrDefault(x => x.Name.Equals(name));
if (requiredAnnot == null)
{
return;
}
var nSelID = pdfViewerControl.Inst.Str2ID("selection.annots", false);
PDFXEdit.IPXV_AnnotSelection itSel = (PDFXEdit.IPXV_AnnotSelection) pdfViewerControl.Doc.CreateStdSel((uint) nSelID);
itSel.Items.Insert(requiredAnnot);
pdfViewerControl.Doc.ActiveSel = itSel;
itSel.Highlight();
}
Regards,
Artsiom
Sasha - PDF-XChange
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - PDF-XChange » Fri Sep 06, 2019 7:13 am
Hello Artsiom,
This code works for me:
Code: Select all
int nSelID = pdfCtl.Inst.Str2ID("selection.annots", false);
PDFXEdit.IPXV_AnnotSelection itSel = (PDFXEdit.IPXV_AnnotSelection)pdfCtl.Doc.CreateStdSel((uint)nSelID);
IPXC_Annotation annot = pdfCtl.Doc.CoreDoc.Pages[0].GetAnnot(0);
itSel.Items.Insert(annot);
pdfCtl.Doc.ActiveSel = itSel;
itSel.Show(true);
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Artsiom
User
Posts: 14 Joined: Fri Aug 23, 2019 7:22 am
Post
by Artsiom » Fri Sep 06, 2019 7:30 am
Thanks Alex, it works!
But earlier annotation highlighting was animated.
Is it possible to animate annotation?
Sasha - PDF-XChange
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - PDF-XChange » Fri Sep 06, 2019 7:35 am
What do you mean by animation?
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Artsiom
User
Posts: 14 Joined: Fri Aug 23, 2019 7:22 am
Post
by Artsiom » Fri Sep 06, 2019 7:51 am
So, look this. It's Viewer SDK select annot
You do not have the required permissions to view the files attached to this post.
Sasha - PDF-XChange
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - PDF-XChange » Fri Sep 06, 2019 11:55 am
Hello Artsiom,
Can you do that in the End-User Editor?
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Artsiom
User
Posts: 14 Joined: Fri Aug 23, 2019 7:22 am
Post
by Artsiom » Fri Sep 06, 2019 12:31 pm
Of course!
This is annot in PDF-XChange Editor (End-User):
2019-09-06_15-30-39.gif
And PDF-XChange Viewer (End-User):
2019-09-06_15-24-48.gif
You do not have the required permissions to view the files attached to this post.
Sasha - PDF-XChange
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - PDF-XChange » Fri Sep 06, 2019 1:07 pm
Hello Artsiom,
I do not see any animation in the Editor.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Artsiom
User
Posts: 14 Joined: Fri Aug 23, 2019 7:22 am
Post
by Artsiom » Fri Sep 06, 2019 1:15 pm
It's true, but the animation was in the ViewerSDK, is it possible to return it?
Sasha - PDF-XChange
User
Posts: 5522 Joined: Fri Nov 21, 2014 8:27 am
Post
by Sasha - PDF-XChange » Fri Sep 06, 2019 2:10 pm
Hello Artsiom,
Sadly no - there is no animation in the Editor.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ