Hi,
I'm working on a tool that must extract text from a selected area (rectangle).
It would be nice if I could draw a selection rectangle like the snapshot- or zoomtool uses and get the coordinates of that rectangle and also get a notification when that rectangle is changed.
I don't think it's possible. if so, is it possible to use the snapshot tool and get the information from that rectangle when a snapshot is taken?
Any help would be appreciated.
Best regards,
Ronald
Snapshot coordinates
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Snapshot coordinates
Hi, Ronald.
You may use next trick:
1. set one Viewer's options:
2. activate new annot creation events:
2. handle the new annots creation event:
HTH
You may use next trick:
1. set one Viewer's options:
Code: Select all
pdfViewer.SetProperty("Commenting.CopySelTextToDrawingPopup", true, 0);
// == [Menu/Edit/Preferences/Commenting] tab, "Copy encircled text into Drawing comment popups"
Code: Select all
pdfViewer.SetProperty("Notifications.NewAnnotAdded.Enabled", true, 0);
Code: Select all
OnEvent(type, name..)
{
if ((type == PXCVA_OnNamedNotify) AND (name == "Notifications.NewAnnotAdded"))
{
object pageIdx;
object annotName;
pdfViewer.GetProperty("Notifications.NewAnnotAdded.Name", out annotName, 0);
pdfViewer.GetProperty("Notifications.NewAnnotAdded.PageIndex", out pageIdx, 0);
string script = "var a = this.getAnnot(" + pageIdx.ToInt() + ", \"" + annotName.ToString() + "\"); if (a != null) a.contents;";
string scriptRes;
pdfViewer.RunJavaScript(script, out scriptRes, 0, PXCVA_NoUI);
scriptRes; // text under any drawing annot, such as "Square", "Circle", "Polygon" etc..
}
}
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 3
- Joined: Fri Aug 22, 2014 1:44 pm
Re: Snapshot coordinates
Thanks for the quick response, this is a lot faster than my ".Text.Chars", ".SP" method.
I noticed that the contents of the annotation is not updated when I resize the annotation but we can do without that functionallity (for now
).
b.t.w. Is het possible to change the mouse cursor or even beter use a custom cursor?
So the user can see a difference between drawing an annotation or selecting an area.
Best regards,
Ronald
I noticed that the contents of the annotation is not updated when I resize the annotation but we can do without that functionallity (for now

b.t.w. Is het possible to change the mouse cursor or even beter use a custom cursor?
So the user can see a difference between drawing an annotation or selecting an area.
Best regards,
Ronald
-
- Site Admin
- Posts: 19868
- Joined: Mon Jan 12, 2009 8:07 am
Re: Snapshot coordinates
Hi Ronald,
No this is not possible in the Viewer AX SDK.
Regards,
Stefan
No this is not possible in the Viewer AX SDK.
Regards,
Stefan
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Snapshot coordinates
Hi, Ronald.
Cheers.
No, option "Commenting.CopySelTextToDrawingPopup" works only for comments creating, not for editing..I noticed that the contents of the annotation is not updated when I resize the annotation but we can do without that functionallity (for now![]()
Cheers.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.