Scroll to Page Location

Nov 25, 2010 at 2:52 AM

Hi,

I'm trying to scroll the FixedPage viewer to a location, other than the top of the page.  The main purpose is to bring an annotation that has been added near the bottom of the page into view.  I don't have a problem getting the viewer to the page the annotation is located on, but I would like to scroll the viewer so the annotation is visible without any additional scrolling.

Can you point me in the direction that would allow me to do this?  It doesn't look like the Viewer API will let me manually set the location.

Any help would be appreciated!

Thanks!
Eric 

Coordinator
Nov 25, 2010 at 10:44 AM

Hi Eric,

The DocumentViewer control contains two BringIntoView methods to scroll to a specific position in a document. You can scroll using a TextPointer or LinkTarget. LinkTargets are used for bookmarking purposes and available LinkTargets are found in the PageContent.LinkTargets property. Alternatively you can scroll to a TextPointer that consists of a PageNumber and a TextIndex. TextIndexes are constructed based on the plain text contents. Useful TextPointer related properties are PageContent.Text, FixedPage.Text, FixedPage.PageStart, FixedPage.PageEnd.

Hope this helps,

- Koen

Nov 25, 2010 at 1:55 PM

No, that doesn't help much.  I should have been more specific.  The XPS documents that I am viewing are scanned images, so the entire page is actually just one big image, there's no text to use or LinkTargets.  I would like users to view the XPS documents to check for errors, if one is found, then they are adding a sticky note to the document for the author to look at and correct.  Again, when the original author comes back into the viewer, I would like to have a list of "errors" (annotations) that, when clicked, brings that annotation into view.

I looked at trying to create a LinkTarget dynamically, so when a sticky note is added to the annotations store, a new LinkTarget would be created to act as a reference for the BringIntoView method, but I couldn't figure out how to accomplish this.

So, with that said, is there a way, other than BringIntoView, that will allow me to manually scroll the Viewer to a specific coordinate?

I hope this gives you a better understanding of what I'm trying to accomplish, sorry for the vagueness in the original post.

Thanks for you're help!
Eric 

Coordinator
Nov 26, 2010 at 10:11 AM

Hi Eric,

What you want is currently not supported; does it help if we add another BringIntoView overload that allows you to navigate to a coordinate within a page? I'm thinking 

void BringIntoView(int pageNumber, Point position)

Does that cover your scenario?

Nov 26, 2010 at 10:15 AM
That would be perfect! I've tried to overload the classes, but I can't get access to the methods that are actually manipulating the page objects. So, if you could somehow expose this third BringIntoView method, that would let me pass in a point, that would be a easily to incorporate! Please let me know what I could can do to help, though honestly, you are probably way faster with the API than I am :-) Thanks! Eric Eric Odom Datalytics LLC toll free 800.763.1957 ext.301 cellular 512.468.7847 eric@datalyticsllc.com Confidentiality Notice: This e-mail message, including any attachments are from Datalytics LLC, and are for the sole use of the intended recipient and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by contacting Datalytics at 1-800-763-1957 and destroy all copies of the original message. On Nov 26, 2010, at 5:11 AM, kozw wrote: > From: kozw > > Hi Eric, > > What you want is currently not supported; does it help if we add another BringIntoView overload that allows you to navigate to a coordinate within a page? I'm thinking > > void BringIntoView(int pageNumber, Point position) > > Does that cover your scenario? > > Read the full discussion online. > > To add a post to this discussion, reply to this email (documenttoolkit@discussions.codeplex.com@discussions.codeplex.com) > > To start a new discussion for this project, email documenttoolkit@discussions.codeplex.com@discussions.codeplex.com > > You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com. > > Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com > That would be perfect! I've tried to overload the classes, but I can't get access to the methods that are actually manipulating the page objects. So, if you could somehow expose this third BringIntoView method, that would let me pass in a point, that would be a easily to incorporate!

Please let me know what I could can do to help, though honestly, you are probably way faster with the API than I am :-)

Thanks!
Eric


Eric Odom
Datalytics LLC
toll free 800.763.1957 ext.301
cellular 512.468.7847


Confidentiality Notice: This e-mail message, including any attachments are from Datalytics LLC, and are for the sole use of the intended recipient and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by contacting Datalytics at 1-800-763-1957 and destroy all copies of the original message.



On Nov 26, 2010, at 5:11 AM, kozw wrote:

From: kozw

Hi Eric,

What you want is currently not supported; does it help if we add another BringIntoView overload that allows you to navigate to a coordinate within a page? I'm thinking

void BringIntoView(int pageNumber, Point position)

Does that cover your scenario?

Read the full discussion online.

To add a post to this discussion, reply to this email (documenttoolkit@discussions.codeplex.com@discussions.codeplex.com)

To start a new discussion for this project, email documenttoolkit@discussions.codeplex.com@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Nov 27, 2010 at 4:01 PM
Edited Nov 27, 2010 at 4:01 PM

Hi Eric,

An internal update of Document Toolkit is available for download at http://firstfloorsoftware.com/downloads/documenttoolkit/FirstFloor.Documents%20(internal).zip. This update contains a new DocumentViewer.BringIntoView(int pageNumber, Point position) method.

Eventually this new method will end up in an official document toolkit release.

Hope this helps,

- Koen

Nov 27, 2010 at 4:04 PM

That's great news Koen!  I'll download and take a look!

Thanks so much for all your help!

-Eric 

Nov 27, 2010 at 4:22 PM

Works perfect!  I should be good to go for a little while, last thing on my list is the ability to draw a "rectangle" annotation type, instead of just a free form ink type.  After that I'm done and we'll be ready to deploy, and of course purchase some licensing ;-)

Thanks again!!

-Eric