Page 1 of 1

AnnotationViewer with multiple pages

Posted: Fri Jun 14, 2019 2:39 pm
by Neralem
Hi,

maybe i'm just too dumb, but how can i programmatically add annotations inside a WpfAnnotationViewer on multiple pages?

I've got an instance of PdfDocument and extract an ImageCollection with the PdfPage.Render() funktion on each page. I've assigned this ImageCollection to the Images property of the WpfAnnotationViewer and set the DisplayMode Property to SingleContinuousColumn.
Now i've created an instance of RectangleAnnotationData and set it up like i want.
After doing that, i add this annotation like so:

Code: Select all

annotationViewer.AnnotationDataCollection.Add(annotationData);
I can't see any way to tell on what page/image the annotation should be :(

Re: AnnotationViewer with multiple pages

Posted: Fri Jun 14, 2019 3:56 pm
by Neralem
Nervermind. I just had to use the AnnotationController and the GetAnnotations(int index) Method. Thanks anyway. Hope this helps someone else.