What's New in 2020 Volume 4: PDF Viewer Flutter | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (175).NET Core  (29).NET MAUI  (208)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (41)Black Friday Deal  (1)Blazor  (220)BoldSign  (15)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (67)Flutter  (133)JavaScript  (221)Microsoft  (119)PDF  (81)Python  (1)React  (101)Streamlit  (1)Succinctly series  (131)Syncfusion  (920)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (37)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (151)Chart  (132)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (633)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (41)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (508)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (11)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (597)What's new  (333)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
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!

googleplay.png

Related Blogs

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

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed