Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (145).NET Core  (23)Angular  (40)ASP.NET  (47)ASP.NET Core  (54)ASP.NET MVC  (84)Azure  (28)Blazor  (57)DocIO  (18)Essential JS 2  (65)Essential Studio  (160)Flutter  (61)JavaScript  (135)Microsoft  (97)PDF  (50)React  (30)Succinctly series  (119)Syncfusion  (428)TypeScript  (30)Uno Platform  (2)UWP  (4)Vue  (26)Webinar  (14)Windows Forms  (52)WPF  (98)Xamarin  (107)XlsIO  (20)Other CategoriesBarcode  (4)BI  (29)Bold BI  (3)Build conference  (6)Business intelligence  (53)Button  (4)C#  (100)Chart  (40)Cloud  (9)Company  (445)Dashboard  (5)Data Science  (3)Data Validation  (3)DataGrid  (31)Development  (238)Doc  (7)eBook  (90)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (14)Extensions  (8)File Manager  (3)Gantt  (7)Gauge  (4)Git  (3)Grid  (25)HTML  (8)Installer  (1)Knockout  (2)LINQPad  (1)Linux  (1)M-Commerce  (1)Metro Studio  (11)Mobile  (151)Mobile MVC  (9)OLAP server  (1)Orubase  (12)Partners  (20)PDF viewer  (18)Performance  (2)PHP  (1)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (5)Road Map  (9)Scheduler  (15)SfDataGrid  (7)Silverlight  (21)Sneak Peek  (12)Solution Services  (2)Spreadsheet  (2)SQL  (4)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (9)Tips and Tricks  (27)UI  (79)Uncategorized  (68)Unix  (2)User interface  (57)Visual State Manager  (1)Visual Studio  (14)Visual Studio Code  (8)Web  (120)What's new  (78)Windows 8  (19)Windows App  (1)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Share on twitter
Share on facebook
Share on linkedin
What's New in 2020 Volume 4 : PDF Viewer Flutter

What’s New in 2020 Volume 4: PDF Viewer Flutter

I’m very excited to share with you the new features and enhancements included in our Flutter PDF Viewer widget:

These features are included in Flutter PDF Viewer in the 2020 Volume 4 release.

Text selection

The PDF Viewer now allows you to select text in a PDF page by long pressing on it, which in turn displays selection handles or bubbles at the top-left and bottom-right corners. Then, you can use the left handle to extend the text selection at the left and top, and the right handle to extend the selection to the right and bottom.

Text selection in Flutter PDF Viewer
Text selection in Flutter PDF Viewer

By default, text selection will be enabled in the PDF Viewer. You can disable the text selection using the enableTextSelection property. The following code example explains this.

@override
Widget build(BuildContext context) {
  return Scaffold(
      body: Container(
          child: SfPdfViewer.network(
              'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf',
              enableTextSelection: false)));
}

The PDF Viewer text selection also includes the following functionalities,

  • Customizing the text selection and its handle color,
  • Obtaining the selected text programmatically.

To learn more about text selection and its features, please refer to our text selection documentation page.

The PDF Viewer now allows you to find instances of text in a PDF document and navigate to each of its occurrences. You can perform the text search and retrieve results using the searchText controller method. It takes the text to be searched and TextSearchOption as parameters. This method searches for the text and highlights all instances of it in the document. This method also returns a PdfTextSearchResult object holding the result values such as total instance count and current highlighted instance index.

The PDF Viewer text search feature also includes the following functionalities,

  • Navigating to different matches of searched text
  • Cancelling the text search
  • Customizing the highlight color of the found instances

To differentiate the current instance from the other instances, the current text instance is highlighted in a dark color, while the rest of the instances will be light. The following code example explains how to perform the text search and retrieve the results.

PdfViewerController _pdfViewerController;
PdfTextSearchResult _searchResult;

@override
void initState() {
  _pdfViewerController = PdfViewerController();
  super.initState();
}
@override
Widget build(BuildContext context) {
  return Scaffold(
      appBar: AppBar(
        title: Text('Syncfusion Flutter PDF Viewer'),
        actions: <Widget>[
          IconButton(
            icon: Icon(
              Icons.search,
              color: Colors.white,
            ),
            onPressed: () async {
              _searchResult = await _pdfViewerController?.searchText('the',
                  searchOption: TextSearchOption.caseSensitive); 
              print('Total instance count: ${_searchResult.totalInstanceCount}');
            },
          ),                  ],
      ),
      body: SfPdfViewer.network(
          'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf',
          controller:_pdfViewerController));
}

With the help of options available in the PDF Viewer text search, you can create and implement your own search toolbar. Here, you can find the example code snippet to create and display a custom search toolbar with search features. The following reference image is the executed example code snippet.

Text search in Flutter PDF Viewer
Text search in Flutter PDF Viewer

To learn more about text search and its features, please refer to our documentation page.

The PDF Viewer allows you to navigate to the desired topic or position by tapping on a document link annotation in the table of contents in a PDF document. By default, navigation using the document link annotation will be enabled. You can disable the navigation using the enableDocumentLinkAnnotation property. The following code example explains this.

@override
Widget build(BuildContext context) {
  return Scaffold(
      body: Container(
          child: SfPdfViewer.network(
              'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf',
              enableDocumentLinkAnnotation: false)));
}

Conclusion

I hope you enjoyed this blog about the new features of the Syncfusion Flutter PDF Viewer available in the 2020 Volume 4 release. You can explore the user guide of PDF Viewer, and you can also check out our samples in this GitHub location. In addition, you can download our demo app from Google Play and the App Store.

If you are an existing Syncfusion user, please download the latest version of Essential Studio from the License & Downloads page and try the new features for yourself. If you aren’t a customer yet, you can try our 30-day free trial to check out these features.

Also, if you wish to send us feedback or would like to ask any questions, please feel free to post them in the comments section below, or contact us through our support forumDirect-Trac, or feedback portal. We are happy to assist you!

If you liked this post, we think you will also enjoy the following:

Tags:

Share this post:

Share on twitter
Share on facebook
Share on linkedin

Leave a comment

Popular Now

Be the first to get updates

Subscribe RSS feed
Scroll To Top