Annotation visibility in the PDFViewer
Hello,
I started using the PdfViewerControl (winform C#) to load and annotate documents which works perfectly, except that the annotation is not visible in the PdfViewerControl?
- I see the Markup annotation (Yellow) when I open the PDF using Adobe Acrobat
- I see a hand mouse cursor when I hover over the annotation in the PdfViewerControl but nothing elese
PdfTextMarkupAnnotation textMarkupAnnotation = new PdfTextMarkupAnnotation(allBounds[0])
{
TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight,
Color = new PdfColor(Color.Yellow),
Opacity = 0.5f,
Text = annotationComment,
TextMarkupColor = Color.Yellow
};
textMarkupAnnotation.Bounds = boundingBox;
page.Annotations.Add(textMarkupAnnotation);
Hi Oussama,
In WinForms
PdfViewer, Currently we don't have
support for viewing annotations. As a workaround, we need to flatten the
annotations before loading the document in the PDFViewer. Please refer below
code snippet for demonstrating how to flatten annotations and load the
document:
|
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("D:\\Input.pdf");
//Flatten the annotations present in the PDF document loadedDocument.FlattenAnnotations();
PDFViewer.Load(loadedDocument);
|
Additionally, we have created a sample for your reference and attached it below
We highly recommend using the WPF PdfViewer hosted in a WinForms application instead of the WinForms PdfViewer. The WPF PdfViewer allows you to view the Annotations in document . For your reference, we have provided a sample link demonstrating this integration.
Sample link: GitHub Sample Link
UG Link:
Enhance WinForms PdfViewer with WPF Features |
Syncfusion®
Documentation Link: Annotations in WPF Pdf Viewer control | Syncfusion
For Annotations in WPF PdfViewer, please refer to the sample link below.
Sample Link: WPF-PDFViewer-Examples/Annotations at master · SyncfusionExamples/WPF-PDFViewer-Examples
Regards,
Yathavakrishnan M
Attachment: WinForms_PDFViewer_9728eed2.zip
Thanks a lot for your quick response :)
I will try the WPF component first and will update the thread!
Thanks.
hello there, just a friendly reminder for anyone having the same issue that using the WPF component worked like a charm :)
We are glad that you found the solution. Please let us know if you need any further assistance.
- 4 Replies
- 3 Participants
- Marked answer
-
OM Oussama Melki
- Jul 17, 2025 11:42 AM UTC
- Aug 18, 2025 06:38 AM UTC