Finding the page an annotation is on in code

Questions, comments and suggestions concerning VintaSoft PDF .NET Plug-in.

Moderator: Alex

Post Reply
IntegraMike
Posts: 56
Joined: Mon Dec 02, 2019 11:19 pm

Finding the page an annotation is on in code

Post by IntegraMike »

Hello,

We're currently in the process of implementing the ability for our application to update annotations through code/business logic and one of the strange things we ran into is in order to get the page that an annotation is on we have to call PdfAnnotation.Document.Pages.IndexOf(PdfAnnotation.Page). It seems like there is probably an easier/better way to do this, so any direction you can provide would be appreciated.

Thanks!
Mike
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: Finding the page an annotation is on in code

Post by Alex »

Hello Mike,

The PdfAnnotation.Page property returns a PDF page associated with annotation:
https://www.vintasoft.com/docs/vsimagin ... /Page.html

Do you need to get page index in PDF document? If yes, you are using correct code because only PdfPageCollection.IndexOf method can return index of element in collection.

Best regards, Alexander
IntegraMike
Posts: 56
Joined: Mon Dec 02, 2019 11:19 pm

Re: Finding the page an annotation is on in code

Post by IntegraMike »

We're looking to note the page number of the document that the annotation is on so thanks for confirming we're doing the right thing!
Post Reply