Rank: Member
Groups: Registered
Joined: 8/13/2019(UTC) Posts: 12  Location: New York
|
I'm trying to programmatically add a square annotation when a user clicks a button in a WPF app and have the annotation appear in the viewer. Is this possible? The code in the button is listed below and is not working as the annotation does not appear after the button click. When is it necessary to call InvalidateVisual, ClearRenderBuffer and UpdateLayout? if (page.Annots == null) page.CreateAnnotations(); FS_RECTF rect = new FS_RECTF(left, top, right, bottom); page.Annots.Add(new PdfSquareAnnotation(page, rect, FS_COLOR.Red, FS_COLOR.Green)); pdfViewer1.InvalidateVisual(); pdfViewer1.ClearRenderBuffer(); pdfViewer1.UpdateLayout(); Thanks, Ted
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 844
Thanks: 2 times Was thanked: 103 time(s) in 101 post(s)
|
Try to call page.Dispose instead of clear render buffer etc. This will cause the page to reload and update all changes Code:
...
page.Dispose();
pdfViewer1.InvalidateVisual();
|
|
|
|
Rank: Member
Groups: Registered
Joined: 8/13/2019(UTC) Posts: 12  Location: New York
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close