Working with PDF Layers in WPF Pdf Viewer
29 Jul 20211 minute to read
The layer support in PDF viewer allows users to toggle the visibility of individual and group of layers in the PDF document to view, print, save, and export as image.
Toggling the visibility of a PDF layer
To toggle the visibility of PDF layers individually, click the eye icon associated with each layer in the layers pane.
Toggling the visibility of the group of layers
To toggle the visibility of a group of PDF layers, click the eye icon associated with parent layer in the layers pane.
Disabling the layers
You can disable the display of the layers present in the PDF document by setting the EnableLayers property to false. Refer to the following code example.
private void Window_Loaded(object sender, RoutedEventArgs e)
{
PdfLoadedDocument pdf = new PdfLoadedDocument("PdfLayers.pdf");
pdfViewer.Load(pdf);
pdfViewer.EnableLayers = false;
}
Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs)
Dim pdf As New PdfLoadedDocument("PdfLayers.pdf")
pdfViewer.Load(pdf)
pdfViewer.EnableLayers = false;
End Sub
You can also achieve the same in XAML using the DependencyProperty illustrated as follows.
<syncfusion:PdfViewerControl x:Name="pdfViewer" EnableLayers="False" />
NOTE
By default, the layer feature is enabled in PDF viewer.
NOTE
You can refer to our WPF PDF Viewer feature tour page for its groundbreaking feature representations. You can also explore our WPF PDF Viewer example to know how to render and configure the pdfviewer.