Try it in your app and let us know what you think in the comment section below. This control allows you to highlight, underline, and strikethrough text add sticky notes and stamps draw shapes and more. We have seen how to hide and show annotations based on the author in a PDF file using the Syncfusion WPF PDF Viewer control. GitHub referenceĪlso, check out the example to show and hide annotations based on author in a PDF using the WPF PDF Viewer. Note: For more details, refer to the Show annotation in WPF PDF Viewer documentation. } Hide and Show Annotations Based on Author in WPF PDF Viewer PdfViewer.ShowAnnotation(annotation.Name) Similarly, you can show the hidden annotations using the ShowAnnotation method. Refer to How to get and set the name of an annotation for more details. Note: Before calling the HideAnnotation method, make sure that the annotation is set with a unique name to avoid conflicts in identifying the required annotation. PdfViewer.HideAnnotation(annotation.Name) Identify whether the annotation was created by the given author. This HideAnnotation function hides the annotation based on the annotation’s name, which is passed as a parameter.įor more details, refer to the Hiding an annotation in WPF PDF Viewer documentation. If the author’s name doesn’t match the name of the current author, obtain the annotation’s name and pass it to the HideAnnotation function. Step 3: Next, check the author’s name in the annotation data to identify the annotations included by other authors. Iterate through the annotations in the page.įor (int j = 0 j < j++) Iterate through the pages to check for the annotations.įor (int i = 0 i < i++) ![]() Step 2: Then, iterate through the document pages and access the annotations in the pages. PdfLoadedDocument pdfLoadedDocument = pdfViewer.LoadedDocument Step 1: First, access the LoadedDocument property of the WPF PDF Viewer containing the details of the annotation. If the user wants, they can override the default author’s name for the annotations using the annotation settings.īased on the author’s name, we can easily distinguish and handle (hide or show) their annotations in a PDF document. By default, while creating annotations using the WPF PDF Viewer, the author’s name will be set to the username information of the user who is currently logged onto the system. Let’s see how to hide the annotations of other users. Then, include the following code in your XAML page to add the WPF PDF Viewer as a child to the window.Create a new WPF project and install the Syncfusion WPF PDF Viewer NuGet package in it.Let’s see how to hide and show annotations based on the author’s name in your PDF using the WPF PDF Viewer control. You can also save, print, export, and import annotations in the hidden state. You can hide all the comments at once, rather than hiding each one individually, or hide a specific set of comments. You can hide or show annotations using the annotation’s name. ![]() This can be done by keeping the comments in the hidden state. Syncfusion’s WPF PDF Viewer control allows you to hide comments in a PDF file without permanently deleting them. ![]() When multiple users are working on a single PDF file, you might need to hide your comments (annotations) from others, ignore comments already present in the PDF file while you work on it, print only specific comments from the file, and so on.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |