February 21, 2020 0

View, Edit and Print PDF Files Using WPF PDF Viewer of Syncfusion

View, Edit and Print PDF Files Using WPF PDF Viewer of Syncfusion


Hello Everyone. Welcome to this video tutorial on how to get started with the WPF PDF Viewer from Syncfusion. In this video, you will learn how to add a PDF Viewer control to a WPF project and how to load and view
a PDF document in it. You will also learn how to use a few of PDF Viewer’s editing and interactive features like Navigation, Annotation. Redaction and more. So let’s get started. In this video I’ll use
Visual Studio 2017. I have already created a WPF project. Now let’s see how to add the PDF Viewer control from the toolbox. In the toolbox, under the Syncfusion control section you will find Pdf Viewer. Syncfusion controls will be configured in the toolbox when you install Syncfusion WPF Essential Studio. If you’re using nuget, then toolbox will show PDF viewer once you install Syncfusion.PDFViewer.WPF nuget  in the project reference. I’ll drag the PDF Viewer and drop it in the designer window. and I’ll set the layout to Reset All. So the control will occupy all the available windows space. Now let’s see how to load a PDF document from the local system to PDF Viewer. In this project I’ll create a class named ViewModel, which implements the INotifyPropertyChanged  interface and define a property named DocumentStream  for binding. Next, I’ll create a constructor for ViewModel. Here I’ll read a PDF file by creating an instance of Filestream. And load a PDF document from a local path. Next, I need to bind the FileStream to PDF Viewer. In Xaml, I’ll set the Window’s DataContext property to ViewModel. And bind the DocumentStream property of Viewmodel to PDF Viewer’s ItemSource property to load the document. Now let’s run the application. You will see PDF viewer with
a built in toolbar and a loaded PDF document. Let’s look at the built in features of PDF viewer. I will get started with the zoom in and zoom out features. To zoom in or out, I’ll change the
zoom percentage level in the toolbar. You can also perform
zoom operations by pressing the control key and rolling the mouse wheel forward or backward direction. As our PDF Viewer supports touch interactions, zoom and all other operations can be efficiently performed by touch devices. You can fit the size of the PDF
file to fill the window using the FitToWidth option. And display one page at a time using the SinglePageView option. Next we will look at the few navigation options in PDF viewer. Rather than scrolling through a document PDF Viewer allows you to reach your desired page
immediately by manually entering the page number in the page number box. Also, the toolbar
has navigation buttons to navigate to the first, last, next and previous pages. You can also navigate to a desired page using thumbnails. To navigate through thumbnails, click the thumbnail icon on the left side of the toolbar. Now, you can view previews of all the pages. You can zoom in
and out of the thumbnails by using the slider or by the buttons. I’ll click the preview image and
immediately that will let me reach the page. If the document contains a hyper
link just click it to view the link in the browser. I have opened the document that
contains bookmarks. So I can view the bookmarked pages by clicking this bookmark icon and easily reach a specific page. If you have a table of contents in the document, click the topic and that will allow you to reach that topic page. Next we
will see how to search text in the document. If you want to search for a
specific word or phrase just click the search icon in the toolbar and type the text that needs to be
searched in the search box. And the occurrence of the target
text will be highlighted in the document. You can also view the
search box by pressing CTRL F. You can select text in a
document by simply dragging the mouse over the required area. To copy the selected text, I’ll right click the selected area, and click the copy option. Now, the text will be copied to the clipboard. You can also copy the
selected text by pressing CTRL C. Next I’ll show how to annotate a PDF document. Annotation is a way of adding additional information to an existing point. PDF Viewer supports many ways to add and edit annotations such as Ink Annotations, Shape Aannotations, Stamp annotations. Sticky Note Annotations, Text Annotations and Text Markup annotations. Ink Annotations let you draw free form lines. To add notes I’ll right click the drawing. Now, I can view a context menu. And I’ll select the Open Pop-up Note option. Now I can add information to it. Other than free form you
can use predefined shapes like lines, rectangles, circles, etc to add annotations from the
drawing tool option. And there is predefined text you can use from this stamp option. With sticky note annotation, you can use a few predefined icons from the sticky note options. You can see a default comment icon is added. To change the applied icon, I’ll right click it. From this option I’ll select Properties. Under the appearance section, you can view a few listed icons and i’ll select one and click OK. You can add free text annotations by clicking the Add textbox option. PDF viewer supports three text markup annotations like Highlight, Underline and Strikethrough. Now, we’ll see how to include handwritten signatures in the PDF document. This feature will help you
to add your own signature to the PDF document. You can modify, remove, flatten the existing ones. In the panning mode, dragging and scrolling of pages can be easily performed in any
direction using mouse and touch interactions. Next we’ll see how
easy it is for you to organize a PDF document using PDF viewer. For that I click the organize icon in the left toolbar. Now you can view preview of all the pages in the document. By hovering over a page, you can see three icons. I’ll click the first icon so you
can see that the page is rotated in a counterclockwise direction.
The second icon also rotates the page but in a clockwise direction. The third icon deletes the page from the document. You can change the
order of the document by simply dragging the page to
the desired location. You can perform the previous
operations for multiple pages to select more than one page.
Press the control key and select multiple pages. Now
I’ll show how to perform reduction in PDF viewer. If
you want to remove confidential information from
the document. Then you can redact the content. For example, I’ll show how to redact this paragraph. For that I’ll click the Redact icon on the left side toolbar. You can see a new toolbar with Redactions options listed. Here, you will see the Mark for Redaction option. I’ll click that and drag the mouse over the
paragraph. Now I’ll click the apply option and the information
in that area will be removed from the document. I have opened
a PDF document that has layers. So, when I click the layers icon in the left toolbar you can view the list of layers in the panel. You can toggle the
visibility of the individual layers and the group of layers by clicking eye icon that is corresponding to each layer in
the layers section. Now I’ll open a Form document and I’ll be able to fill, edit, flatten and save data using the Acro Form Field in the document. This helps when you
need to enter data into a PDF document you can also export and
import form data using PDF viewer. You can save the
modified document by clicking the save option in the toolbar. You can print the document by clicking the print icon on the
toolbar and change the default print settings in the print dialog box. You can also perform silent printing in PDF viewer. To perform silent printing call the print method of PDF viewer
and when you run the application printing will happen with default print settings. So, we have seen how to add the PDF viewer control to a WPF project and how to bind a PDF document to it. Also, we learn how to use a
few interactive features. Thank you for watching this video. If you find this video useful hit the like button and
subscribe to our channel.

Leave a Reply

Your email address will not be published. Required fields are marked *

© Copyright 2019. Amrab Angladeshi. Designed by Space-Themes.com.