From 827ff1961bb019ff1d9db9bfe2d7e58b734fdb34 Mon Sep 17 00:00:00 2001 From: AbinayaEruthayaraj Date: Mon, 6 Jul 2026 19:38:18 +0530 Subject: [PATCH 1/3] Updated the getting started file for flutter pdfviewer control. --- .../PDF/PDF-Viewer/flutter/getting-started.md | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md b/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md index 43eb7a3167..cf724eda23 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md @@ -1,6 +1,6 @@ --- layout: post -title: Getting started with Flutter PDF Viewer widget | Syncfusion +title: Getting Started with Flutter PDF Viewer Widget | Syncfusion description: Learn here about getting started with Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget, its elements, and more. platform: document-processing control: SfPdfViewer @@ -18,34 +18,33 @@ To get started quickly, you can also check out our video tutorial below. Create a simple project using the instructions given in the [Getting Started with your first Flutter app](https://docs.flutter.dev/get-started/test-drive#choose-your-ide) documentation. ## Install the Flutter PDF Viewer package -Install the [Syncfusion® Flutter PDF Viewer](https://pub.dev/packages/syncfusion_flutter_pdfviewer/versions) package to your project by run the following command in your project’s terminal: +Install the [Syncfusion® Flutter PDF Viewer](https://pub.dev/packages/syncfusion_flutter_pdfviewer/versions) package to your project by running the following command in your project’s terminal: {% tabs %} -{% highlight yaml tabtitle="powershell" %} +{% highlight tabtitle="powershell" %} flutter pub add syncfusion_flutter_pdfviewer {% endhighlight %} {% endtabs %} -## Specify the asset path -Add the asset path to your `pubspec.yaml` file under the flutter section. +## Specify Asset Path +Create an assets folder in the project root, add a sample PDF file (for example, flutter-succinctly.pdf) to it, and specify the asset path in `pubspec.yaml` file under the flutter section. {% tabs %} {% highlight yaml tabtitle="pubspec.yaml" %} flutter: - -assets: -   - assets/ + assets: +   - assets/ {% endhighlight %} {% endtabs %} -## Add the script tags -For the web platform, we have used [PdfJs](https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js) for rendering the PDF pages, so the script file must be referred to in your `web/index.html` file. +## Add Script Tags +For the web platform, we have used [PdfJs](https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.min.js) for rendering the PDF pages, so the script files must be added to your `web/index.html` file. -In your `web/index.html` file, add the following `script` tags, somewhere in the `head` or `body` of the document: +In your `web/index.html` file, add the following `script` tags, in the `body` of the document: For PdfJs library version 4.0 and above: {% tabs %} @@ -71,23 +70,22 @@ For PdfJs library versions below 4.0: {% endhighlight %} {% endtabs %} -N> A version above **2.11.338** is recommended for using annotation support. This will not flatten the unsupported annotations while rendering the pages. - +N> A version above **2.11.338** is recommended for using annotation support. Unsupported annotations are preserved rather than flattened during rendering. ## Import Package In the `main.dart` file, import the required package. {% tabs %} -{% highlight Dart %} +{% highlight dart %} import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart'; {% endhighlight %} {% endtabs %} -## Add the SfPdfViewer widget and load document -In the `main.dart` file, replace the build method with the following code to display the PDF using SfPdfViewer +## Add the SfPdfViewer Widget and Load Document +In the `main.dart` file, replace the build method with the following code to display the PDF using [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html). {% tabs %} {% highlight dart hl_lines="4" %} From 9a8879c74d74ae47bafadd01b91c5d00f66e3c49 Mon Sep 17 00:00:00 2001 From: AbinayaSF4962 Date: Fri, 10 Jul 2026 15:50:51 +0530 Subject: [PATCH 2/3] Updated the getting started file for flutter pdfviewer control. --- .../PDF/PDF-Viewer/flutter/accessibility.md | 19 +++++++++---------- .../flutter/add-remove-modify-annotations.md | 8 ++++---- .../flutter/annotation-collection.md | 2 +- .../flutter/annotations-overview.md | 2 +- .../PDF-Viewer/flutter/bookmark-navigation.md | 6 +++--- .../flutter/document-link-annotation.md | 4 ++-- .../flutter/document-load-callbacks.md | 4 ++-- .../PDF/PDF-Viewer/flutter/form-filling.md | 14 +++++++------- .../PDF-Viewer/flutter/gesture-callbacks.md | 8 ++++---- .../PDF/PDF-Viewer/flutter/getting-started.md | 10 +++++----- .../flutter/hyperlink-navigation.md | 10 +++++----- .../PDF/PDF-Viewer/flutter/localization.md | 10 +++++----- .../flutter/lock-unlock-annotations.md | 4 ++-- .../PDF/PDF-Viewer/flutter/magnification.md | 2 +- .../flutter/open-a-document-from-base64.md | 12 ++++++++++-- .../open-a-document-from-local-storage.md | 4 ++-- .../flutter/open-a-document-from-memory.md | 2 +- .../PDF/PDF-Viewer/flutter/open-a-document.md | 2 +- .../PDF/PDF-Viewer/flutter/overview.md | 4 ++-- .../page-layout-and-scroll-direction.md | 8 ++++---- .../PDF/PDF-Viewer/flutter/page-navigation.md | 12 +++++++----- .../PDF/PDF-Viewer/flutter/right-to-left.md | 6 +++--- .../flutter/select-deselect-annotations.md | 8 +++----- .../PDF/PDF-Viewer/flutter/sticky-notes.md | 4 ++-- .../PDF/PDF-Viewer/flutter/text-markup.md | 4 ++-- .../PDF/PDF-Viewer/flutter/text-search.md | 13 +++++++++++-- .../PDF/PDF-Viewer/flutter/text-selection.md | 6 +++--- .../PDF-Viewer/flutter/ui-customization.md | 14 +++++++++++++- .../PDF/PDF-Viewer/flutter/undo-redo.md | 2 +- .../viewing-password-protected-pdf-files.md | 11 +++++------ 30 files changed, 121 insertions(+), 94 deletions(-) diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/accessibility.md b/Document-Processing/PDF/PDF-Viewer/flutter/accessibility.md index 995b8941ad..a168722bd9 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/accessibility.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/accessibility.md @@ -14,16 +14,15 @@ documentation: ug The [`SfPdfViewer`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) can be accessed by screen readers by wrapping the [`SfPdfViewer`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) widget with the [`Semantics`](https://api.flutter.dev/flutter/widgets/Semantics-class.html) widget. {% tabs %} -{% highlight dart hl_lines="4 5 6 7 8 9" %} +{% highlight dart hl_lines="4 5 6 7 8" %} @override Widget build(BuildContext context) { return Scaffold( body: Semantics( label: 'Flutter PDF Viewer', - child: - SfPdfViewer.network( - 'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf'), + child: SfPdfViewer.network( + 'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf'), ), ); } @@ -37,11 +36,11 @@ The `SfPdfViewer` [theming](https://help.syncfusion.com/flutter/themes) support The following APIs allow you to customize the colors of the following elements: * [searchTextHighlightColor](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/flutter/text-search#customize-the-search-text-highlight-color) -* [selectionColor and selectionHandleColor](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/flutter/text-selection#customize-the-text-selection-and-its-handle-color) +* [selectionColor and selectionHandleColor](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/flutter/text-selection#customate-the-text-selection-and-its-handle-color) ## Large Fonts -The font size of the [`SfPdfViewer`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) will be automatically scaled based on the device settings. +The font size of the [`SfPdfViewer`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) UI elements will be automatically scaled based on the device settings. Also, you can change the font size of the [`SfPdfViewer`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) elements using the following APIs: @@ -56,7 +55,7 @@ The `SfPdfViewer` supports the following keyboard interactions: - + @@ -110,7 +109,7 @@ The `SfPdfViewer` supports the following keyboard interactions: - + @@ -119,7 +118,7 @@ The `SfPdfViewer` supports the following keyboard interactions: - + @@ -131,4 +130,4 @@ The `SfPdfViewer` supports the following keyboard interactions: ## Easier Touch Targets -The [`SfPdfViewer`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) has a touch target of 48 x 48, as per the standard for all elements. \ No newline at end of file +The [`SfPdfViewer`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) has a touch target of 48 x 48, as per the Material Design standard. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/add-remove-modify-annotations.md b/Document-Processing/PDF/PDF-Viewer/flutter/add-remove-modify-annotations.md index 59c0733509..9834f6b427 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/add-remove-modify-annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/add-remove-modify-annotations.md @@ -17,7 +17,7 @@ This section will go through how to add annotations to a PDF document programmat ### Add Annotations Programmatically -You can programmatically add a new annotation to the PDF document by creating an annotation instance and providing it as a parameter to the [addAnnotation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/addAnnotation.html) method of the `PdfViewerController` class. The following example shows how to create an instance of a highlight annotation and add it to the PDF document. Similarly, you can create and add other types of annotation. +You can programmatically add a new annotation to the PDF document by creating an annotation instance and providing it as a parameter to the [addAnnotation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/addAnnotation.html) method of the `PdfViewerController` class. The following example shows how to create an instance of a highlight annotation and add it to the PDF document. Similarly, you can create and add other types of annotations. {% tabs %} {% highlight dart hl_lines="11" %} @@ -90,7 +90,7 @@ void removeFirstAnnotation() { ### Remove All Annotations -You can programmatically remove all the annotations from a document by calling the [removeAllAnnotations](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/removeAllAnnotations.html) method. The optional `pageNumber` parameter can be used to clear the form field data on a specific page. By default, the pageNumber parameter is 0. Refer to the following code example. +You can programmatically remove all the annotations from a document by calling the [removeAllAnnotations](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/removeAllAnnotations.html) method. The optional `pageNumber` parameter can be used to clear the annotations on a specific page. By default, the `pageNumber` parameter is 0, which removes annotations from all pages of the PDF document. Refer to the following code example. {% tabs %} {% highlight dart hl_lines="3 8" %} @@ -138,7 +138,7 @@ This section will go through different methods of editing annotations in a PDF d ### Edit a Specific Annotation -You can edit the properties of an annotation from the document programmatically by accessing the specific annotation instance from the Annotation collection. The following example shows how to edit the first annotation in the annotation collection. Similarly, you can modify the other properties also. +You can edit the properties of an annotation from the document programmatically by accessing the specific annotation instance from the Annotation collection. The following example shows how to edit the first annotation in the annotation collection. Similarly, you can also modify the other properties. {% tabs %} {% highlight dart hl_lines="9 10" %} @@ -182,4 +182,4 @@ Widget build(BuildContext context) { } {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/annotation-collection.md b/Document-Processing/PDF/PDF-Viewer/flutter/annotation-collection.md index 9b2bfb1844..e9b6fa76fb 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/annotation-collection.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/annotation-collection.md @@ -9,7 +9,7 @@ documentation: ug # Annotation Collection in Flutter PDF Viewer widget (SfPdfViewer) -The annotations in the PDF document can be accessed by the [getAnnotations](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/getAnnotations.html) method of the [PdfViewerController](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController-class.html). The return value of the function will have the Annotation collection as soon as the document is loaded in the PDF viewer. The following code example shows how the annotation collection can be accessed. +The annotations in the PDF document can be accessed by the [getAnnotations](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/getAnnotations.html) method of the [PdfViewerController](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController-class.html). The method returns the annotation collection as soon as the document is loaded in the PDF viewer. The following code example shows how the annotation collection can be accessed. {% tabs %} {% highlight dart hl_lines="9 10" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/annotations-overview.md b/Document-Processing/PDF/PDF-Viewer/flutter/annotations-overview.md index 369ee03b9a..c6c8cd37a5 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/annotations-overview.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/annotations-overview.md @@ -9,7 +9,7 @@ documentation: ug # Annotations in Flutter PDF Viewer (SfPdfViewer) -The `SfPdfViewer` allows you to add, remove, and modify annotations in PDF documents. This section will go through the various types and functionalities available in the PDF Viewer for working with annotations. +The `SfPdfViewer` allows you to add, remove, and modify annotations in PDF documents. This section covers the various types and features available in the PDF Viewer for working with annotations. ## Supported Annotation Types diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/bookmark-navigation.md b/Document-Processing/PDF/PDF-Viewer/flutter/bookmark-navigation.md index a2c5634e8f..a089326ee5 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/bookmark-navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/bookmark-navigation.md @@ -13,13 +13,13 @@ Navigate to the desired bookmark topics using the default bookmark view or the c ## Open and Close the Built-in Bookmark View Programmatically -The built-in bookmark view in the `SfPdfViewer` can be opened using the [openBookmarkView](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewerState/openBookmarkView.html) method, and it can be closed either by tapping the close icon or the device's back button. Also, we can close the bookmark programmatically by using the Navigator’s pop method. +The built-in bookmark view in the `SfPdfViewer` can be opened using the [openBookmarkView](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewerState/openBookmarkView.html) method, and it can be closed either by tapping the close icon or the device's back button. Also, we can close the bookmark view programmatically by using the Navigator’s pop method. * You can use the [isBookmarkViewOpen](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewerState/isBookmarkViewOpen.html) property of the `SfPdfViewerState` class to know whether the built-in bookmark view is open or not. ![Bookmark view](images/bookmark-navigation/bookmark_view.png) -The following code example explains the opening of the built-in bookmark view programmatically. +The following code example shows how to open the built-in bookmark view programmatically. {% tabs %} {% highlight dart hl_lines="1 15" %} @@ -65,7 +65,7 @@ Widget build(BuildContext context) { ## Navigate to the Desired Bookmark Topic Programmatically -You can navigate to the desired bookmark topic programmatically using the [jumpToBookmark](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpToBookmark.html) controller method. The following code example explains the same. +You can navigate to the desired bookmark topic programmatically using the [jumpToBookmark](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpToBookmark.html) controller method. The following code example explains this functionality. N> Import **'package:syncfusion_flutter_pdf/pdf.dart'** in the Dart code if you use the [PdfBookmark](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmark-class.html) parameter. diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/document-link-annotation.md b/Document-Processing/PDF/PDF-Viewer/flutter/document-link-annotation.md index bd13cd22b6..6f4d3e523c 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/document-link-annotation.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/document-link-annotation.md @@ -9,11 +9,11 @@ documentation: ug # Document Link Annotation in Flutter PDF Viewer (SfPdfViewer) -By default, the [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) allows you to navigate to the desired topic or position by tapping its document link annotation in the table of contents in a PDF document. +By default, the [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) allows you to navigate to a specific topic or position within a PDF document by tapping a document link annotation. ## Enable or Disable the Document Link Annotation Navigation -You can enable or disable the navigation of document link annotations using the [enableDocumentLinkAnnotation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/enableDocumentLinkAnnotation.html) property. The following code example explains the same. +You can enable or disable the navigation of document link annotations using the [enableDocumentLinkAnnotation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/enableDocumentLinkAnnotation.html) property. The default value of this property is `true`. The following code example explains how to disable the document link annotation navigation. {% tabs %} {% highlight dart hl_lines="6" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/document-load-callbacks.md b/Document-Processing/PDF/PDF-Viewer/flutter/document-load-callbacks.md index 261d4a1b2f..c213a74c33 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/document-load-callbacks.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/document-load-callbacks.md @@ -1,7 +1,7 @@ --- layout: post title: Document Load Callbacks in Flutter PDF Viewer widget | Syncfusion -description: Learn here all about the document load callbacks in Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget +description: Learn all about the document load callbacks in Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget platform: document-processing control: SfPdfViewer documentation: ug @@ -78,4 +78,4 @@ Widget build(BuildContext context) { } {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/form-filling.md b/Document-Processing/PDF/PDF-Viewer/flutter/form-filling.md index 3a8f806d60..bfc4a4de47 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/form-filling.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/form-filling.md @@ -280,7 +280,7 @@ Widget build(BuildContext context) { ## Customize the visibility of built-in Signature pad -By default, the `SfPdfViewer` displays the signature pad when tapped on the signature form field. You can customize its visibility using the [canShowSignaturePad](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/canShowSignaturePadDialog.html) property. The following code example explains this. +By default, the `SfPdfViewer` displays the signature pad when tapped on the signature form field. You can customize its visibility using the [canShowSignaturePadDialog](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/canShowSignaturePadDialog.html) property. The following code example explains this. {% tabs %} {% highlight dart hl_lines="9" %} @@ -579,7 +579,7 @@ Widget build(BuildContext context) { {% endhighlight %} {% endtabs %} -## Importing and Exporting form data +## Importing and Exporting form data The Flutter PDF viewer allows users to import and export form data to and from PDF documents. The import and export of form data support the following extensions: @@ -590,7 +590,7 @@ The Flutter PDF viewer allows users to import and export form data to and from P The required file type can be chosen from the [DataFormat](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/DataFormat.html) enumeration. In the following sections, only the `xfdf` file type is explained for brevity. -N> Import ‘package:syncfusion_flutter_pdf/pdf.dart’ in the Dart code to use the [DartFormat](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/DataFormat.html) parameter. +N> Import ‘package:syncfusion_flutter_pdf/pdf.dart’ in the Dart code to use the [DataFormat](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/DataFormat.html) parameter. ### Exporting form data @@ -745,7 +745,7 @@ N> This `undoController` is common for annotations and form fields. You do not n ## Callbacks -The `SfPdfViewer` supports the [PdfFormFieldFocusChangeCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldFocusChangeCallback.html) to notify the interaction with the form fields and the [PdfFormFieldValueChangedCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldValueChangedCallback.html) to notify the values changes in the form fields. +The `SfPdfViewer` supports the [PdfFormFieldFocusChangeCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldFocusChangeCallback.html) to notify the interaction with the form fields and the [PdfFormFieldValueChangedCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldValueChangedCallback.html) to notify the value changes in the form fields. ### Form field focus change callback @@ -776,7 +776,7 @@ N> The `PdfFormFieldFocusChangeCallback` only triggers for text boxes and signat ### Form field value changed callback -The [onFormFieldValueChanged](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/onFormFieldValueChanged.html) callback triggers when the value is changed in the form field. The [PdfFormFieldValueChangedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldValueChangedDetails-class.html) the `formField` instance along with its `oldValue` and `newValue`. The following code example explains this. +The [onFormFieldValueChanged](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/onFormFieldValueChanged.html) callback triggers when the value is changed in the form field. The [PdfFormFieldValueChangedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfFormFieldValueChangedDetails-class.html) returns the `formField` instance along with its `oldValue` and `newValue`. The following code example explains this. {% tabs %} {% highlight dart hl_lines="9 10 11 12" %} @@ -1038,7 +1038,7 @@ Future _validateAndSaveForm() async { if (formField.text == null || formField.text.isEmpty) { errors.add('Name is required.'); } else if (formField.text.length < 3) { - errors.add('Name should have atleast 3 characters.'); + errors.add('Name should have at least 3 characters.'); } else if (formField.text.length > 30) { errors.add('Name should not exceed 30 characters.'); } else if (formField.text.contains(RegExp(r'[0-9]'))) { @@ -1065,7 +1065,7 @@ Future _validateAndSaveForm() async { } else if (formField is PdfListBoxFormField) { if (formField.selectedItems == null || formField.selectedItems!.isEmpty) { - errors.add('Please select atleast one course.'); + errors.add('Please select at least one course.'); } } else if (formField is PdfSignatureFormField) { if (formField.signature == null) { diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/gesture-callbacks.md b/Document-Processing/PDF/PDF-Viewer/flutter/gesture-callbacks.md index a16e4c344a..beec90f11c 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/gesture-callbacks.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/gesture-callbacks.md @@ -9,7 +9,7 @@ documentation: ug # Gesture Callbacks in Flutter PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) supports the [PdfGestureCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureTapCallback.html) to notify the touch or mouse interaction with the widget. +The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) supports the [PdfGestureTapCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureTapCallback.html) to notify the touch or mouse interaction with the widget. ## Tap Callback @@ -17,14 +17,14 @@ The [onTap](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pd * [pageNumber](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureDetails/pageNumber.html) – This property returns the page number on which the tap took place. The value ranges from 1 to the total number of pages in the PDF document. If the tap occurs outside any PDF page boundaries, the result will be -1. -* [pagePosition](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureDetails/pagePosition.html) – This property returns the page’s tapped position in PDF coordinates. The coordinates have their origin at the top-left of the page. The number of the tapped page is identified by the PageNumber property. If the tap occurs outside any PDF page boundaries, the result will be (-1, -1). +* [pagePosition](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureDetails/pagePosition.html) – This property returns the tapped position on the page in PDF coordinates. The coordinates have their origin at the top-left of the page. The tapped page is identified by the pageNumber property. If the tap occurs outside any PDF page boundaries, the result will be (-1, -1). * [position](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfGestureDetails/position.html) – This property returns the tapped position on the PDF Viewer widget. The coordinate space starts at the top left of the widget. The following code example illustrates how to retrieve information from the `PdfGestureDetails` and handle the `onTap` callback. {% tabs %} -{% highlight dart hl_lines="9 10 11" %} +{% highlight dart hl_lines="12 13 14" %} @override Widget build(BuildContext context) { @@ -42,4 +42,4 @@ Widget build(BuildContext context) { } {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md b/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md index cf724eda23..67fd8d51d1 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/getting-started.md @@ -18,7 +18,7 @@ To get started quickly, you can also check out our video tutorial below. Create a simple project using the instructions given in the [Getting Started with your first Flutter app](https://docs.flutter.dev/get-started/test-drive#choose-your-ide) documentation. ## Install the Flutter PDF Viewer package -Install the [Syncfusion® Flutter PDF Viewer](https://pub.dev/packages/syncfusion_flutter_pdfviewer/versions) package to your project by running the following command in your project’s terminal: +Install the [Syncfusion® Flutter PDF Viewer](https://pub.dev/packages/syncfusion_flutter_pdfviewer/versions) package to your project by running the following command in your project's terminal: {% tabs %} {% highlight tabtitle="powershell" %} @@ -29,14 +29,14 @@ flutter pub add syncfusion_flutter_pdfviewer {% endtabs %} ## Specify Asset Path -Create an assets folder in the project root, add a sample PDF file (for example, flutter-succinctly.pdf) to it, and specify the asset path in `pubspec.yaml` file under the flutter section. +Create an assets folder in the project root, add a sample PDF file (for example, flutter-succinctly.pdf) to it, and specify the asset path in the `pubspec.yaml` file under the flutter section. {% tabs %} {% highlight yaml tabtitle="pubspec.yaml" %} flutter: assets: -   - assets/ + - assets/ {% endhighlight %} {% endtabs %} @@ -72,7 +72,7 @@ For PdfJs library versions below 4.0: N> A version above **2.11.338** is recommended for using annotation support. Unsupported annotations are preserved rather than flattened during rendering. -## Import Package +## Import the Package In the `main.dart` file, import the required package. @@ -100,7 +100,7 @@ Widget build(BuildContext context) { {% endhighlight %} {% endtabs %} -N> You can refer to our [Flutter PDF Viewer](https://www.syncfusion.com/flutter-widgets/flutter-pdf-viewer) feature tour page for its groundbreaking feature representations. You can also explore our [Flutter PDF Viewer example](https://flutter.syncfusion.com/#/pdf-viewer/getting-started), which shows you how to render and configure the PDF Viewer. +N> You can refer to our [Flutter PDF Viewer](https://www.syncfusion.com/flutter-widgets/flutter-pdf-viewer) feature tour page for its groundbreaking features. You can also explore our [Flutter PDF Viewer example](https://flutter.syncfusion.com/#/pdf-viewer/getting-started), which shows you how to render and configure the PDF Viewer. ## See Also - [Open Document](./open-a-document) diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/hyperlink-navigation.md b/Document-Processing/PDF/PDF-Viewer/flutter/hyperlink-navigation.md index 4cea43a406..86dd7fffc4 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/hyperlink-navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/hyperlink-navigation.md @@ -9,13 +9,13 @@ documentation: ug # Hyperlink Navigation in Flutter PDF Viewer (SfPdfViewer) -The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) allows you to open URLs or website links in the default browser. You can hide the built-in hyperlink navigation dialog or add a customized one with supported functionalities. +The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) allows you to open URLs or website links in the default browser. You can hide the built-in hyperlink navigation dialog or add a customized one using the available callbacks with supported functionalities. ![Hyperlink navigation dialog](images/hyperlink-navigation/hyperlink_navigation_dialog.jpg) ## Enable or Disable the Hyperlink Navigation -You can enable or disable the hyperlink navigation using the [enableHyperlinkNavigation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/enableHyperlinkNavigation.html) property. The following code example explains the same. +You can enable or disable the hyperlink navigation using the [enableHyperlinkNavigation](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/enableHyperlinkNavigation.html) property. By default, the hyperlink navigation is enabled. The following code example explains how to disable it. {% tabs %} {% highlight dart hl_lines="9" %} @@ -38,7 +38,7 @@ You can enable or disable the hyperlink navigation using the [enableHyperlinkNav ## Customize the Visibility of the Hyperlink Navigation Dialog -By default, the built-in hyperlink navigation dialog will be displayed when any hyperlink is clicked. You can customize the visibility of the hyperlink navigation dialog using the [canShowHyperlinkDialog](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/canShowHyperlinkDialog.html) property. The following code example explains the same. +By default, the built-in hyperlink navigation dialog will be displayed when any hyperlink is clicked. You can customize the visibility of the hyperlink navigation dialog using the [canShowHyperlinkDialog](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/canShowHyperlinkDialog.html) property. The following code example explains how to hide the built-in dialog. {% tabs %} {% highlight dart hl_lines="9" %} @@ -61,11 +61,11 @@ By default, the built-in hyperlink navigation dialog will be displayed when any ## Callbacks -The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) hyperlink navigation supports the [PdfHyperlinkClickedCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedCallback.html) to notify when any hyperlink is clicked. +The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) hyperlink navigation supports the [PdfHyperlinkClickedCallback](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedCallback.html) to notify when any hyperlink is clicked. This callback can also be used to implement a custom hyperlink dialog or to override the default navigation behavior. ### Hyperlink Clicked Callback -The [onHyperlinkClicked](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/onHyperlinkClicked.html) callback triggers when any hyperlink in the PDF document is clicked. The [PdfHyperlinkClickedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedDetails-class.html) will return the [uri](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedDetails/uri.html) clicked in the PDF document. The following code example explains the same. +The [onHyperlinkClicked](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/onHyperlinkClicked.html) callback triggers when any hyperlink in the PDF document is clicked. The [PdfHyperlinkClickedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedDetails-class.html) provides the [uri](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfHyperlinkClickedDetails/uri.html) of the clicked hyperlink in the PDF document. Returning `false` from the callback prevents the default hyperlink navigation dialog from being displayed, allowing you to implement custom hyperlink handling. The following code example explains the same. {% tabs %} {% highlight dart hl_lines="9 10 11" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/localization.md b/Document-Processing/PDF/PDF-Viewer/flutter/localization.md index 9e2b059812..56ab1e31f5 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/localization.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/localization.md @@ -9,20 +9,20 @@ documentation: ug # Localization in Flutter PDF Viewer (SfPdfViewer) -By default, the `SfPdfViewer` widget supports US English localization. You can change the other languages by specifying the `MaterialApp` properties and adding the `flutter_localizations` and `syncfusion_localizations` packages to your application. +By default, the `SfPdfViewer` widget supports US English localization. You can change to other languages by specifying the `MaterialApp` properties and adding the `flutter_localizations` and `syncfusion_localizations` packages to your application. To use `flutter_localizations` and `syncfusion_localizations`, add the packages as a dependency to the `pubspec.yaml` file. {% highlight dart %} dependencies: -flutter_localizations: - sdk: flutter -syncfusion_localizations: ^XX.X.XX + flutter_localizations: + sdk: flutter + syncfusion_localizations: ^XX.X.XX {% endhighlight %} -Next, import the `flutter_localizations` and `syncfusion_localizations` library and specify the `localizationsDelegates` and `supportedLocales` for `MaterialApp` to localize the contents in the `SfPdfViewer` (page navigation dialog and bookmark view). +Next, import the `flutter_localizations` and `syncfusion_localizations` libraries and specify the `localizationsDelegates` and `supportedLocales` for `MaterialApp` to localize the contents in the `SfPdfViewer` (page navigation dialog and bookmark view). {% tabs %} {% highlight dart hl_lines="1 2 7 8 9 10 11 12 13 14 15 16 17" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/lock-unlock-annotations.md b/Document-Processing/PDF/PDF-Viewer/flutter/lock-unlock-annotations.md index a9a2222003..6832e68e20 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/lock-unlock-annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/lock-unlock-annotations.md @@ -1,7 +1,7 @@ --- layout: post title: Locking and Unlocking Annotations in Flutter PDF Viewer | Syncfusion -description: Learn here all about locking and unlocking annotations in PDF documents using the Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget and more. +description: Learn here all about locking and unlocking annotations in PDF documents using the Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget. platform: document-processing control: SfPdfViewer documentation: ug @@ -86,4 +86,4 @@ void lockSelectedAnnotation(Annotation selectedAnnotation) { {% endhighlight %} {% endtabs %} -* Similarly, to unlock the selected annotation, set the `isLocked` property value to false. +* Similarly, to unlock the selected annotation, set the `isLocked` property value to false. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/magnification.md b/Document-Processing/PDF/PDF-Viewer/flutter/magnification.md index 00c4fdda39..251ec801a0 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/magnification.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/magnification.md @@ -107,7 +107,7 @@ The [onZoomLevelChanged](https://pub.dev/documentation/syncfusion_flutter_pdfvie • When the double-tap zoom is performed. • When the `zoomLevel` property is changed. -The [PdfZoomDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfZoomDetails-class.html) will return the `oldZoomLevel` title and `newZoomLevel` values. The following code example explains the same. +The [PdfZoomDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfZoomDetails-class.html) will return the `oldZoomLevel` and `newZoomLevel` values. The following code example explains the same. {% tabs %} {% highlight dart hl_lines="6 7 8" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-base64.md b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-base64.md index d28615e390..763aa3a30b 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-base64.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-base64.md @@ -34,6 +34,10 @@ class MainApp extends StatelessWidget { @override Widget build(BuildContext context) { + // Base64 string of the PDF document. + // Replace with the actual base64 string of your PDF. + const String base64 = 'YOUR_BASE64_STRING_HERE'; + // Pass the base64 string of the PDF document to the SyncfusionPDFViewer widget. return const SyncfusionPDFViewer(base64: base64); } @@ -66,7 +70,7 @@ class _SyncfusionPDFViewerState extends State { ## Using Custom PDFSource -To load a document from a base64 string, you can convert the base64 string to a [Uint8List](https://api.flutter.dev/flutter/dart-typed_data/Uint8List-class.html) using the [base64Decode](https://api.flutter.dev/flutter/dart-convert/base64Decode.html) method and pass it to the [SfPdfViewer.memory](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.memory.html) constructor. The following code example explains the same. +To load a document from a base64 string, you can convert the base64 string to a [Uint8List](https://api.flutter.dev/flutter/dart-typed_data/Uint8List-class.html) using the [base64Decode](https://api.flutter.dev/flutter/dart-convert/base64Decode.html) method and pass it to the SfPdfViewer constructor through a custom PDFSource implementation. The following code example explains the same. * Import the `dart:convert` package to use the [base64Decode](https://api.flutter.dev/flutter/dart-convert/base64Decode.html) method. @@ -90,6 +94,10 @@ class MainApp extends StatelessWidget { @override Widget build(BuildContext context) { + // Base64 string of the PDF document. + // Replace with the actual base64 string of your PDF. + const String _base64 = 'YOUR_BASE64_STRING_HERE'; + // Pass the base64 string of the PDF document to the SyncfusionPDFViewer widget. return const SyncfusionPDFViewer(base64: _base64); } @@ -117,7 +125,7 @@ class _SyncfusionPDFViewerState extends State { } /// Custom PDFSource implementation for loading PDF from base64 encoded string. -class Base64PDFSource extends PDFSource { +class Base64PDFSource extends PdfSource { /// Creates a new instance of Base64PDFSource with the provided base64 string. Base64PDFSource(this._base64); diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-local-storage.md b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-local-storage.md index c9ea963ca3..535a30bb4d 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-local-storage.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-local-storage.md @@ -9,7 +9,7 @@ documentation: ug # Open a PDF From Local Storage in Flutter PDF Viewer (SfPdfViewer) -The [SfPdfViewer.file](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.file.html) creates a widget that displays the PDF document obtained from a [`File`](https://api.flutter.dev/flutter/dart-io/File-class.html). The following code example explains the same. +The [SfPdfViewer.file](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.file.html) creates a widget that displays the PDF document obtained from a [`File`](https://api.flutter.dev/flutter/dart-io/File-class.html). The following code example demonstrates this. {% tabs %} {% highlight dart hl_lines="4 5" %} @@ -24,6 +24,6 @@ Widget build(BuildContext context) { {% endhighlight %} {% endtabs %} -N> On Android, this may require the `android.permission.READ_EXTERNAL_STORAGE`. +N> On Android, add the `android.permission.READ_EXTERNAL_STORAGE` permission in the `AndroidManifest.xml` file. N> Since the file system is not accessible from the browser, [SfPdfViewer.file](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.file.html) is not supported on Flutter Web. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-memory.md b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-memory.md index feea399074..3f1e99613e 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-memory.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document-from-memory.md @@ -9,7 +9,7 @@ documentation: ug # Open a Document From Memory in Flutter PDF Viewer (SfPdfViewer) -The [SfPdfViewer.memory](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.memory.html) creates a widget that displays the PDF document obtained from the [Uint8List](https://api.flutter.dev/flutter/dart-typed_data/Uint8List-class.html). The following code example explains the same. +The [SfPdfViewer.memory](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/SfPdfViewer.memory.html) creates a widget that displays the PDF document obtained from the [Uint8List](https://api.flutter.dev/flutter/dart-typed_data/Uint8List-class.html). The following code example demonstrates this. {% tabs %} {% highlight dart hl_lines="4 5" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document.md b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document.md index 76e5dfe528..4e7225e6d9 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/open-a-document.md @@ -41,7 +41,7 @@ Widget build(BuildContext context) { N> It is recommended not to use both the [initialScrollOffset](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialScrollOffset.html) and [initialPageNumber](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialPageNumber.html) properties at the same time. If both properties are defined, the [initialPageNumber](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialPageNumber.html) will be prioritized over the [initialScrollOffset](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialScrollOffset.html). -## Load Document with the Specified Scroll Offset Position or Zoom Level +## Load the Document with the Specified Scroll Offset Position or Zoom Level The `SfPdfViewer` allows you to load the document with the specified scroll offset position or zoom level using the [initialScrollOffset](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialScrollOffset.html) and [initialZoomLevel](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/initialZoomLevel.html) properties. The following code example explains the same. diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/overview.md b/Document-Processing/PDF/PDF-Viewer/flutter/overview.md index 7f1756dd47..368a86c4aa 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/overview.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/overview.md @@ -1,7 +1,7 @@ --- layout: post title: About Flutter PDF Viewer widget | Syncfusion -description: Learn here all about introduction of Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget, its features, and more. +description: Learn all about the Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget, its features, and more. platform: document-processing control: SfPdfViewer documentation: ug @@ -29,4 +29,4 @@ The Syncfusion® [Flutter PDF Viewer](https://www.syncfusion.com/f * [Accessibility](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/flutter/accessibility) * [Right to Left (RTL)](https://help.syncfusion.com/document-processing/pdf/pdf-viewer/flutter/right-to-left) -N> You can also explore our [Flutter PDF Viewer example](https://flutter.syncfusion.com/#/pdf-viewer/getting-started) that shows you how to render and configure the PDF Viewer. +N> You can also explore our [Flutter PDF Viewer example](https://flutter.syncfusion.com/#/pdf-viewer/getting-started) that shows you how to render and configure the PDF Viewer. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/page-layout-and-scroll-direction.md b/Document-Processing/PDF/PDF-Viewer/flutter/page-layout-and-scroll-direction.md index cb57045668..e30b6e3f5d 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/page-layout-and-scroll-direction.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/page-layout-and-scroll-direction.md @@ -20,7 +20,7 @@ The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/lat ### Continuous Page Layout Mode -By default, the `continuous` page layout mode is enabled, which scrolls the PDF pages vertically and horizontally. To enable the `continuous` page layout mode in `SfPdfViewer`, use the following code sample. +By default, the `continuous` page layout mode is enabled, which displays all the PDF pages in a continuous flow. The scroll direction can be configured using the `scrollDirection` property. To set the page layout mode to `continuous` in `SfPdfViewer`, use the following code sample. {% tabs %} {% highlight dart hl_lines="6" %} @@ -38,7 +38,7 @@ Widget build(BuildContext context) { ### Single Page Layout Mode -In `Single` page layout mode, PDFs will be displayed page by page horizontally. To enable the `Single` page layout mode in `SfPdfViewer`, use the following code sample. +In `Single` page layout mode, the PDF pages are displayed one at a time, with horizontal scrolling by default. To set the page layout mode to `Single` in `SfPdfViewer`, use the following code sample. {% tabs %} {% highlight dart hl_lines="6" %} @@ -67,7 +67,7 @@ If the scroll direction is not specified, continuous page layout mode defaults t ### Vertical Scrolling -By default, `Vertical` scrolling is enabled, which moves the PDF pages from up to down. To enable the `Vertical` scrolling in `SfPdfViewer`, use the following code sample. +By default, `Vertical` scrolling is enabled, which scrolls the PDF pages from top to bottom. To set the scroll direction to `Vertical` in `SfPdfViewer`, use the following code sample. {% tabs %} {% highlight dart hl_lines="6" %} @@ -85,7 +85,7 @@ Widget build(BuildContext context) { ### Horizontal Scrolling -In `Horizontal` scrolling, PDF pages can be scrolled from left to right. To enable the `Horizontal` scrolling in `SfPdfViewer`, use the following code sample. +In `Horizontal` scrolling, PDF pages are scrolled from left to right. To set the scroll direction to `Horizontal` in `SfPdfViewer`, use the following code sample. {% tabs %} {% highlight dart hl_lines="6" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/page-navigation.md b/Document-Processing/PDF/PDF-Viewer/flutter/page-navigation.md index d74fd5ae64..5a0759eda7 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/page-navigation.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/page-navigation.md @@ -9,16 +9,16 @@ documentation: ug # Page Navigation in Flutter PDF Viewer (SfPdfViewer) -Navigate to the desired pages instantly either by using the page navigation dialog or the controller methods programmatically. If the desired page doesn’t exist, then the navigation will not happen, and the older page will be retained. +Navigate to the desired pages instantly either by using the page navigation dialog available in the built-in toolbar, or by using the controller methods programmatically. If the desired page doesn’t exist, then the navigation will not happen, and the current page will be retained. ![Page navigation dialog](images/page-navigation/page_navigation_dialog.png) ## Navigate to the Desired Page Programmatically -The [jumpToPage](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpToPage.html) controller method helps you to navigate to the specified page number in a PDF document. The following code example explains the same. +The [jumpToPage](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpToPage.html) controller method helps you to navigate to the specified page number in a PDF document. The page number is 1-based. The following code example explains the same. {% tabs %} -{% highlight dart hl_lines="21" %} +{% highlight dart hl_lines="22" %} late PdfViewerController _pdfViewerController; @@ -159,7 +159,7 @@ Widget build(BuildContext context) { ## Navigate to the Desired Offset Programmatically -The [jumpTo](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpTo.html) controller method moves the scroll position of the `SfPdfViewer` to the specified horizontal and vertical offset. If the specified offset value is wrong, then the scroll will not happen, and the older position will be retained. +The [jumpTo](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/jumpTo.html) controller method moves the scroll position of the `SfPdfViewer` to the specified horizontal and vertical offset. Both `xOffset` and `yOffset` accept `double` values in logical pixels. If the specified offset value is wrong, then the scroll will not happen, and the current position will be retained. N> Both the `xOffset` and `yOffset` are optional parameters and if the offset values are not provided, then the `SfPdfViewer` will be scrolled or moved to the default position (0, 0). @@ -217,7 +217,7 @@ The [onPageChanged](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/l The [PdfPageChangedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfPageChangedDetails-class.html) will return the `oldPageNumber`, `newPageNumber`, `isFirstPage`, and `isLastPage` values. The following code example explains the same. {% tabs %} -{% highlight dart hl_lines="6 7 8 9" %} +{% highlight dart hl_lines="6 7 8 9 10" %} @override Widget build(BuildContext context) { @@ -225,8 +225,10 @@ Widget build(BuildContext context) { body: SfPdfViewer.network( 'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf', onPageChanged: (PdfPageChangedDetails details) { + print(details.oldPageNumber); print(details.newPageNumber); print(details.isFirstPage); + print(details.isLastPage); }, )); } diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/right-to-left.md b/Document-Processing/PDF/PDF-Viewer/flutter/right-to-left.md index ccc2e7af16..55540fb09c 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/right-to-left.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/right-to-left.md @@ -17,7 +17,7 @@ Right-to-left rendering can be switched in the following ways: ### Wrapping the SfPdfViewer with Directionality Widget -To change the rendering direction from right to left, wrap the [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) widget inside the [Directionality](https://api.flutter.dev/flutter/widgets/Directionality-class.html) widget and set the [textDirection](https://api.flutter.dev/flutter/widgets/Directionality/textDirection.html) property as [TextDirection.rtl](https://api.flutter.dev/flutter/widgets/Directionality/textDirection.html). +To change the rendering direction from right to left, wrap the [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) widget inside the [Directionality](https://api.flutter.dev/flutter/widgets/Directionality-class.html) widget and set the [textDirection](https://api.flutter.dev/flutter/widgets/Directionality/textDirection.html) property as [TextDirection.rtl](https://api.flutter.dev/flutter/dart-ui/TextDirection.html). {% tabs %} {% highlight dart hl_lines="26 27 28 29 30 31 32" %} @@ -69,8 +69,8 @@ To use `flutter_localizations`, add the package as a dependency in the `pubspec. {% highlight dart %} dependencies: -flutter_localizations: - sdk: flutter + flutter_localizations: + sdk: flutter {% endhighlight %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/select-deselect-annotations.md b/Document-Processing/PDF/PDF-Viewer/flutter/select-deselect-annotations.md index 5e8cdb0edc..fbee6d60df 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/select-deselect-annotations.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/select-deselect-annotations.md @@ -63,14 +63,12 @@ Widget build(BuildContext context) { ### Customizing Selector Appearance -The `annotationSettings` property of `PdfViewerController` allows you to customize the default selector color. The following example explains how to customize the selector color for locked and unlocked annotations. +The `annotationSettings` property of `SfPdfViewer` allows you to customize the default selector color. The following example explains how to customize the selector color for locked and unlocked annotations. {% tabs %} {% highlight dart %} -void customizeSelectorAppearance() { - PdfAnnotationSettings annotationSettings = - _pdfViewerController.annotationSettings; +void customizeSelectorAppearance(PdfAnnotationSettings annotationSettings) { // For unlocked annotations. annotationSettings.selector.color = Colors.blue; // For locked annotations. @@ -102,7 +100,7 @@ void deselectAnnotation(Annotation selectedAnnotation) { ### Annotation Deselected Callback -The callback provided to the `onAnnotationDeselected` property is triggered when an annotation is deselected interactively or programmatically. The following code sample explains how to use this callback. +The callback provided to the [onAnnotationDeselected](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/onAnnotationDeselected.html) property is triggered when an annotation is deselected interactively or programmatically. The following code sample explains how to use this callback. {% tabs %} {% highlight dart hl_lines="7 8 9 10" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/sticky-notes.md b/Document-Processing/PDF/PDF-Viewer/flutter/sticky-notes.md index 90ee5eaeba..7b362ad8a3 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/sticky-notes.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/sticky-notes.md @@ -9,7 +9,7 @@ documentation: ug # Sticky Note Annotations in Flutter PDF Viewer Widget (SfPdfViewer) -The sticky note annotation feature of `SfPdfViewer` allows you to add, remove, and modify sticky notes in a PDF document. This feature can help add comments or notes to specific parts of a document to clarify complex concepts, terms, or ideas. This section will cover the various functions available in `SfPdfViewer` for working with sticky note annotations. +The sticky note annotation feature of `SfPdfViewer` allows you to add and modify sticky notes in a PDF document. This feature can help add comments or notes to specific parts of a document to clarify complex concepts, terms, or ideas. This section will cover the various functions available in `SfPdfViewer` for working with sticky note annotations. ## Types of Sticky Notes @@ -103,7 +103,7 @@ void customizeDefaultStickyNoteSettings() { // Modify the default properties. stickyNoteSettings.icon = PdfStickyNoteIcon.comment; // Set the default icon to Comment. - stickyNoteSettings.color = Colors.yellow; // Stroke color + stickyNoteSettings.color = Colors.yellow; // Color of the sticky note. stickyNoteSettings.opacity = 0.75; // 75% Opacity } diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/text-markup.md b/Document-Processing/PDF/PDF-Viewer/flutter/text-markup.md index 9ab8ca9a6d..5e8835b12d 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/text-markup.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/text-markup.md @@ -27,7 +27,7 @@ This section will go through how to add text markup annotations to a PDF documen You can add text markup annotations to a PDF document by touching (or mouse down) and dragging using the [annotationMode](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/annotationMode.html) property of the PdfViewerController. The following steps explain how to add a text markup annotation on a text in a PDF: -1. Set the [annotationMode](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/annotationMode.html) property of the SfPdfViewer to any text markups (e.g., `highlight`). It activates the highlight annotation mode on the control. +1. Set the [annotationMode](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/annotationMode.html) property of the PdfViewerController to any text markups (e.g., `highlight`). It activates the highlight annotation mode on the control. 2. Place your finger (or mouse) on the text in the PDF document where you want to start adding the text markup. 3. Drag the finger (or cursor) across the text to select it. 4. Complete adding the text markup to the selected text by releasing the finger (or cursor). @@ -41,7 +41,7 @@ The following code explains how to enable the strikethrough annotation mode. Sim {% highlight dart %} void enableStrikethroughAnnotationMode() { - // Enable the strikeout annotation mode. + // Enable the strikethrough annotation mode. _pdfViewerController.annotationMode = PdfAnnotationMode.strikethrough; } diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/text-search.md b/Document-Processing/PDF/PDF-Viewer/flutter/text-search.md index 34a291158f..edc4b97bb0 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/text-search.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/text-search.md @@ -15,6 +15,8 @@ The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/lat The [searchText](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfViewerController/searchText.html) controller method is used to initiate the text search and it takes the text to be searched and [TextSearchOption](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/TextSearchOption.html) as parameters. This method searches for the text, highlights all the instances of the text in the document, and returns the [PdfTextSearchResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult-class.html) object holding the result values such as total instance count, current highlighted instance index, and more. The [PdfTextSearchResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult-class.html) object will also help you navigate to the different searched text instances available and cancel the search operation. +You can use the [hasResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/hasResult.html) property to check whether the search has produced any matches and the [isSearchCompleted](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/isSearchCompleted.html) property to know whether the search operation has finished on all the pages. + On mobile and desktop platforms, the search will be performed asynchronously, so the results will be returned periodically on a page-by-page basis, which can be retrieved using the `PdfTextSearchResult.addListener` method in the application. Whereas on the web platform, the search will be performed synchronously, so the result will be returned only after completing the search on all the pages. This is because `isolate` is not supported for the web platform yet. @@ -23,9 +25,16 @@ To differentiate the highlighted texts, the current text instance highlight colo N> Import **'package:syncfusion_flutter_pdf/pdf.dart'** in the Dart code if you use the [TextSearchOption](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/TextSearchOption.html) parameter. +The `TextSearchOption` enum supports the following values: `caseSensitive` to perform a case-sensitive search and `none` to perform a case-insensitive search. + {% tabs %} {% highlight dart hl_lines="23 24 25 26 27 28 29 30 31 32 33 34 35 36" %} +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart'; +import 'package:syncfusion_flutter_pdf/pdf.dart'; + late PdfViewerController _pdfViewerController; late PdfTextSearchResult _searchResult; @@ -218,7 +227,7 @@ Widget build(BuildContext context) { ## Customize the Search Text Highlight Color -The colors in which the current instance and other instances are highlighted can be customized with the help of [currentSearchTextHighlightColor](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/currentSearchTextHighlightColor.html) and [otherSearchTextHighlightColor](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/otherSearchTextHighlightColor.html) property. The default highlight color is **Orange** [Color(0xFFE56E00)] and the current instance highlight color opacity (with respect to this property) will be higher than the other instances. By default, the current instance highlight color opacity will be 60% and the other instances color opacity will be 30%. +The colors in which the current instance and other instances are highlighted can be customized with the help of [currentSearchTextHighlightColor](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/currentSearchTextHighlightColor.html) and [otherSearchTextHighlightColor](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/otherSearchTextHighlightColor.html) properties. The default highlight color is **Orange** [Color(0xFFE56E00)] and the current instance highlight color opacity (with respect to this property) will be higher than the other instances. By default, the current instance highlight color opacity will be 60% and the other instances' color opacity will be 30%. The following code example explains how to customize the search text highlight color. @@ -273,7 +282,7 @@ Widget build(BuildContext context) { {% endhighlight %} {% endtabs %} -## How to Identify if There is No Instance Found for the Text Being Searched? +## How to Identify if No Instance is Found for the Searched Text? The [totalInstanceCount](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/totalInstanceCount.html) property in the [PdfTextSearchResult](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult-class.html) object can be used to identify if no instance of the searched text is found in the PDF document. That is, if [totalInstanceCount](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfTextSearchResult/totalInstanceCount.html) returns value 0, then there is no matching instance found for the searched text. The following code explains the same. diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/text-selection.md b/Document-Processing/PDF/PDF-Viewer/flutter/text-selection.md index ffcffc8b67..d6a6bfca4e 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/text-selection.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/text-selection.md @@ -13,7 +13,7 @@ On a touch device, the [SfPdfViewer](https://pub.dev/documentation/syncfusion_fl On a desktop web browser, text selection can also be performed using mouse dragging with the [`selection`](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfInteractionMode.html) interaction mode enabled. -N> Images in the document will not be selected, and multiple-page text selection is not supported for now. +N> Images in the document will not be selected, and multiple-page text selection is not supported currently. ## Enable or Disable Text Selection @@ -74,7 +74,7 @@ class _HomePageState extends State { {% endhighlight %} {% endtabs %} -## Customize the visibility of the text selection context menu +## Customize the Visibility of the Text Selection Context Menu The `canShowTextSelectionMenu` property allows the user to customize the visibility of the built-in text selection context menu. You can assign `false` to this property to disable the text selection context menu. The following code example explains how to disable the built-in text selection context menu in the PDF viewer. @@ -86,7 +86,7 @@ Widget build(BuildContext context) { return Scaffold( body: Container( child: SfPdfViewer.network( - 'https://cdn.syncfusion.com/content/PDFViewer/encrypted.pdf', + 'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf', canShowTextSelectionMenu: false, ), ), diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/ui-customization.md b/Document-Processing/PDF/PDF-Viewer/flutter/ui-customization.md index 51b709f2a0..b328426059 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/ui-customization.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/ui-customization.md @@ -11,9 +11,21 @@ documentation: ug This section walks you through the UI customization options supported in the [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html) widget. +## Prerequisites + +To use the `SfPdfViewer` widget, add the [`syncfusion_flutter_pdfviewer`](https://pub.dev/packages/syncfusion_flutter_pdfviewer) package to your `pubspec.yaml` file and import it in your code: + +{% tabs %} +{% highlight dart %} + +import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart'; + +{% endhighlight %} +{% endtabs %} + ## Customize the Space Displayed Between the PDF Pages -By default, the `SfPdfViewer` displays spacing between the PDF pages with a value of **4 pixels**. You can customize the space being displayed using the [pageSpacing](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/pageSpacing.html) property. The following code example explains the same. +By default, the `SfPdfViewer` displays spacing between the PDF pages with a value of **4 pixels**. You can customize the space displayed using the [pageSpacing](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/pageSpacing.html) property. The following code example explains the same. {% tabs %} {% highlight dart hl_lines="6" %} diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/undo-redo.md b/Document-Processing/PDF/PDF-Viewer/flutter/undo-redo.md index 4dd80da7a1..00093a0851 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/undo-redo.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/undo-redo.md @@ -11,7 +11,7 @@ documentation: ug If you performed any undesired actions when adding, removing, or editing annotations, you can undo and redo the action to restore the previous state. This section will go through how to undo and redo the changes made to the annotations. -For desktop platforms such as Windows, macOS, Linux, and desktop web, you can use the following shortcut keys to perform the actions. +For desktop platforms such as Windows, macOS, Linux, and Web, you can use the following shortcut keys to perform the actions.
ActionAction Windows Macintosh LinuxCONTROL + 0
Shortcut for Text SearchShortcuts for Text Search
Open the search toolbarCONTROL + F
Shortcut for Text SelectionShortcuts for Text Selection
Copy the selected text
diff --git a/Document-Processing/PDF/PDF-Viewer/flutter/viewing-password-protected-pdf-files.md b/Document-Processing/PDF/PDF-Viewer/flutter/viewing-password-protected-pdf-files.md index 5e87a04620..7c5da17cc0 100644 --- a/Document-Processing/PDF/PDF-Viewer/flutter/viewing-password-protected-pdf-files.md +++ b/Document-Processing/PDF/PDF-Viewer/flutter/viewing-password-protected-pdf-files.md @@ -1,7 +1,7 @@ --- layout: post title: Viewing password-protected PDFs in Flutter PDF Viewer | Syncfusion -description: Learn here all about loading password-protected PDF feature of Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget and more. +description: Learn here all about loading password-protected PDFs using the Syncfusion® Flutter PDF Viewer (SfPdfViewer) widget and more. platform: document-processing control: SfPdfViewer documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Viewing Password-Protected PDFs in Flutter PDF Viewer (SfPdfViewer) -To load a password-protected document without a password or with an invalid password in [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html), use the [password](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/password.html) property. The default password dialog will be displayed. +To load a password-protected document, use the [password](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer/password.html) property in [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/SfPdfViewer-class.html). When the password is not provided or is invalid, the default password dialog will be displayed. ![Password dialog](images/password-dialog/password-dialog.png) @@ -84,9 +84,8 @@ class _CustomPasswordDialogState extends State { }, onDocumentLoadFailed: (details) { if (details.description.contains('password')) { - if (details.description.contains('password') && - _hasPasswordDialog) { - _errorText = "Invalid password !!"; + if (_hasPasswordDialog) { + _errorText = "Invalid password!"; _formKey.currentState?.validate(); _textFieldController.clear(); _passwordDialogFocusNode.requestFocus(); @@ -264,4 +263,4 @@ class _CustomPasswordDialogState extends State { {% endhighlight %} {% endtabs %} -![Custom Password dialog](images/password-dialog/custompassword-dialog.png) +![Custom Password dialog](images/password-dialog/custompassword-dialog.png) \ No newline at end of file From 40f84c1f725a7c1be79a79851ab2891950ad37d1 Mon Sep 17 00:00:00 2001 From: AbinayaSF4962 Date: Fri, 10 Jul 2026 16:10:38 +0530 Subject: [PATCH 3/3] Updated the all md files for flutter pdf library control. --- .../PDF-Library/flutter/getting-started.md | 24 +++---- .../flutter/loading-and-saving-document.md | 19 +++--- .../PDF/PDF-Library/flutter/overview.md | 20 +++--- .../flutter/working-with-annotations.md | 28 ++++---- .../flutter/working-with-attachments.md | 4 +- .../flutter/working-with-bookmarks.md | 27 ++++---- .../flutter/working-with-digital-signature.md | 65 +++++++++++-------- .../flutter/working-with-document.md | 40 ++++++------ .../flutter/working-with-flow-layout.md | 10 +-- .../PDF-Library/flutter/working-with-forms.md | 28 ++++---- .../working-with-headers-and-footers.md | 20 +++--- .../flutter/working-with-hyperlinks.md | 6 +- .../flutter/working-with-images.md | 12 ++-- .../flutter/working-with-layers.md | 6 +- .../PDF-Library/flutter/working-with-lists.md | 6 +- .../PDF-Library/flutter/working-with-pages.md | 17 ++--- .../flutter/working-with-pdf-conformance.md | 8 +-- .../flutter/working-with-pdf-templates.md | 12 ++-- .../flutter/working-with-security.md | 26 ++++---- .../flutter/working-with-shapes.md | 4 +- .../flutter/working-with-tables.md | 14 ++-- .../flutter/working-with-text-extraction.md | 16 ++--- .../PDF-Library/flutter/working-with-text.md | 26 ++++---- .../flutter/working-with-watermarks.md | 6 +- 24 files changed, 227 insertions(+), 217 deletions(-) diff --git a/Document-Processing/PDF/PDF-Library/flutter/getting-started.md b/Document-Processing/PDF/PDF-Library/flutter/getting-started.md index dfe0965ead..4e97dfebc8 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/getting-started.md +++ b/Document-Processing/PDF/PDF-Library/flutter/getting-started.md @@ -16,7 +16,7 @@ Check the following video to quickly get started with creating a Flutter PDF doc ## Steps to create PDF document in Flutter application -Create a simple project using the instructions given in the [`Getting Started with your first Flutter app'](https://docs.flutter.dev/get-started/test-drive#choose-your-ide) documentation. +Create a simple project using the instructions given in the [`Getting Started with your first Flutter app`](https://docs.flutter.dev/get-started/test-drive#choose-your-ide) documentation. **Add dependency** @@ -38,9 +38,9 @@ N> Here **xx.x.xx** denotes the current version of [`Syncfusion Flutter PDF`](ht Run the following command to get the required packages. {% tabs %} -{% highlight dart tabtitle="dart" %} +{% highlight powershell tabtitle="POWERSHELL" %} -$ flutter pub get +flutter pub get {% endhighlight %} {% endtabs %} @@ -67,8 +67,8 @@ Widget build(BuildContext context) { return Scaffold( body: Center( child: TextButton( - onPressed: _createPDF, - child: Text('Create PDF') + onPressed: _createPDF, + child: Text('Create PDF'), ), ), ); @@ -113,7 +113,7 @@ You can save and open a PDF document in desktop by using the following steps: Configure and enable the desktop support to run the app. {% tabs %} -{% highlight dart tabtitle="dart" %} +{% highlight dart tabtitle="dart" %} flutter config --enable--desktop @@ -129,10 +129,10 @@ Here you can get more details about [`How to add desktop support in the app`](ht Add the following packages to your pub spec file. {% tabs %} -{% highlight dart tabtitle="dart" %} +{% highlight dart tabtitle="dart" %} -path_provider: ^1.6.5 -open_file: ^3.0.1 +path_provider: ^2.0.7 +open_file: ^3.2.1 {% endhighlight %} {% endtabs %} @@ -275,11 +275,11 @@ Add the following code in the header section of index.html file under the web fo ## Save and download a PDF document in WASM -step 1: Add the [web](https://pub.dev/packages/web) package as a dependency in your **pubspec.yaml** file. +**Step 1:** Add the [web](https://pub.dev/packages/web) package as a dependency in your **pubspec.yaml** file. -step 2: Create a new Dart file called **save_file_wasm.dart**. +**Step 2:** Create a new Dart file called **save_file_wasm.dart**. -step 3: Add the following code: +**Step 3:** Add the following code: **Import package** diff --git a/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md b/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md index 9e3680c4e1..174655811d 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md +++ b/Document-Processing/PDF/PDF-Library/flutter/loading-and-saving-document.md @@ -1,13 +1,13 @@ --- layout: post -title: Open and save PDF file in Flutter PDF library | Syncfusion -description: Learn here all about Open and save PDF file feature of Syncfusion Flutter PDF non-UI library and more. +title: Open and save a PDF file in Flutter PDF library | Syncfusion +description: Learn here all about Open and save a PDF file feature of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug --- -# Open and save PDF file in Flutter PDF +# Open and save a PDF file in Flutter PDF ## Opening an existing PDF document @@ -15,7 +15,7 @@ You can open an existing PDF document by using the [`PdfDocument`](https://pub.d {% tabs %} {% highlight dart tabtitle="dart" %} - +import 'dart:io'; //Opens an existing document from the list of bytes PdfDocument document = PdfDocument(inputBytes: File('input.pdf').readAsBytesSync()); @@ -23,21 +23,20 @@ PdfDocument document = {% endhighlight %} {% endtabs %} -## Opening an existing PDF document from the base 64 string +## Opening an existing PDF document from the Base64 string -You can open an existing document from the base 64 string by using the [`PdfDocument`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument-class.html) class as shown below. +You can open an existing document from the Base64 string by using the [`PdfDocument`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument-class.html) class as shown below. {% tabs %} {% highlight dart tabtitle="dart" %} - -//Opens an existing document from the base 64 string +//Opens an existing document from the Base64 string PdfDocument document = PdfDocument.fromBase64String( 'JVBERi0xLjcNCiWDkvr+DQoxIDAgb2JqDQo8PA0KL1R5cGUgL0NhdGFsb2cNCi9QYWdlcyAyIDAgUg0KPj4NCmVuZG9iag0KMiAwIG9iag0KPDwNCi9UeXBlIC9QYWdlcw0KL0tpZHMgWzMgMCBSXQ0KL0NvdW50IDENCi9SZXNvdXJjZXMgPDw+Pg0KDQovTWVkaWFCb3ggWzAgMCA1OTUgODQyXQ0KPj4NCmVuZG9iag0KMyAwIG9iag0KPDwNCi9Db3VudCAxDQovVHlwZSAvUGFnZXMNCi9LaWRzIFs0IDAgUl0NCi9QYXJlbnQgMiAwIFINCj4+DQplbmRvYmoNCjQgMCBvYmoNCjw8DQovVHlwZSAvUGFnZQ0KL1BhcmVudCAzIDAgUg0KPj4NCmVuZG9iag0KeHJlZg0KMCA1DQowMDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDAwMTcgMDAwMDAgbg0KMDAwMDAwMDA3MiAwMDAwMCBuDQowMDAwMDAwMTgwIDAwMDAwIG4NCjAwMDAwMDAyNTkgMDAwMDAgbg0KdHJhaWxlcg0KPDwNCi9Sb290IDEgMCBSDQovU2l6ZSA1DQo+Pg0KDQpzdGFydHhyZWYNCjMxMg0KJSVFT0Y='); {% endhighlight %} {% endtabs %} -## Saving a PDF document to list of bytes +## Saving a PDF document to a list of bytes You can save the manipulated PDF document as a list of bytes using the [`save`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html) method of [`PdfDocument`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument-class.html) class. Also, you can save the list of bytes to the file system as follows. @@ -55,4 +54,4 @@ List bytes =await document.save(); File('output.pdf').writeAsBytes(bytes); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/overview.md b/Document-Processing/PDF/PDF-Library/flutter/overview.md index d3729928ab..0010675bb2 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/overview.md +++ b/Document-Processing/PDF/PDF-Library/flutter/overview.md @@ -9,21 +9,21 @@ documentation: ug # Flutter PDF Overview -The Syncfusion® Flutter PDF is a library written natively in Dart for creating the PDF documents from scratch. The library can be used in Flutter Mobile and Web platforms without the dependency of Adobe Acrobat. The creation of PDF follows the most popular PDF 1.7 (ISO 32000-1) and latest PDF 2.0 (ISO 32000-2) specifications. +The Syncfusion® Flutter PDF is a library written natively in Dart for creating PDF documents from scratch. It can be used in Flutter Mobile and Web platforms without requiring Adobe Acrobat. The creation of PDF follows the most popular PDF 1.7 (ISO 32000-1) and the latest PDF 2.0 (ISO 32000-2) specifications. Check the following video for a quick overview of Syncfusion Flutter UI Widgets and File Format Packages. {% youtube "https://youtu.be/FwUSJtv-3NY?si=doGR-fOkvghf-UUa" %} ## Key features of Syncfusion® Flutter PDF: -* Support to create PDF files from scratch. -* Support to add text and drawing shapes. -* Support to add ordered and unordered lists. -* Support to draw raster images like JPEG and PNG formats. -* Support to add hyperlink and document link annotations. -* Support to add tables. -* Support to add headers and footers in PDF document. -* Support to add bookmarks in PDF document. -* Support to protect PDF document by encryption. +* Creates PDF files from scratch. +* Adds text and draws shapes. +* Adds ordered and unordered lists. +* Draws raster images such as JPEG and PNG formats. +* Adds hyperlink and document link annotations. +* Adds tables. +* Adds headers and footers in PDF documents. +* Adds bookmarks in PDF documents. +* Protects PDF documents with encryption. You can get the sample from this link: [`Flutter PDF`](https://github.com/syncfusion/flutter-examples). \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md index 357d7c47ca..ec2e1beae4 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-annotations.md @@ -254,8 +254,8 @@ PdfPage page = document.pages.add(); //Creates a new document link annotation PdfDocumentLinkAnnotation documentLinkAnnotation = PdfDocumentLinkAnnotation(Rect.fromLTWH(10, 40, 30, 30), - setAppearance: true, - PdfDestination(document.pages.add(), Offset(10, 0))); + PdfDestination(document.pages.add(), Offset(10, 0)), + setAppearance: true); //Adds this annotation the page. page.annotations.add(documentLinkAnnotation); @@ -305,7 +305,7 @@ document.dispose(); This annotation is used to navigate to a particular web URI while clicking on the link text. -The following code example explains how to add the Text Web Link annotation in a PDF document using the PdfTextWebLinkAnnotation. +The following code example explains how to add the Text Web Link annotation in a PDF document using the PdfTextWebLink. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -415,7 +415,7 @@ Pop-up annotation displays text in a pop-up window for entry and editing. It typically does not appear alone but is associated with markup annotation, its parent annotation. -PdfPopupAnnotation is used to add pop-up annotation in a PDF document. +PdfPopupAnnotation is used to add a pop-up annotation in a PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -471,9 +471,9 @@ document.dispose(); ## Flatten annotation -Annotations can be flattened by removing the existing annotation and replacing it with the graphics objects that would resemble the annotation and it cannot be edited. +Annotations can be flattened by removing the existing annotation and replacing it with graphics objects that resemble the annotation, making it non-editable. -This can be achieved by enabling the flattenAllAnnotations method . Please refer to the sample for flattening all the annotations in the PDF document. +This can be achieved by calling the flattenAllAnnotations method. Please refer to the sample for flattening all the annotations in the PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -571,7 +571,7 @@ annotation.innerColor = PdfColor(0, 255, 0); annotation.text = 'Modified Annotation'; annotation.author = 'Syncfusion'; annotation.modifiedDate = DateTime.now(); -annotation.setAppearance: true; +annotation.setAppearance = true; //Saves the document File('output.pdf').writeAsBytes(await document.save()); @@ -652,7 +652,7 @@ If set, do not display the annotation on the screens or allow the user to intera +If set, do not allow the user to interact with the annotation.

+If set, invert the interpretation of the noView flag for certain events.

readOnly

-If set, do not allow the user to interact with annotation.

locked

@@ -660,7 +660,7 @@ If set, do not allow the annotation to be deleted or its properties to be modifi
toggleNoView

-If set, invert the interpretation of the noView flat for certain events.

@@ -793,11 +793,11 @@ To export annotation data to the FDF file from the PDF document, you can use the //Load an existing PDF document. PdfDocument document = PdfDocument(inputBytes: File('input.pdf').readAsBytesSync()); - //Export the annotations to FDF file format + //Export the annotations to FDF file format. List bytes = document.exportAnnotation(PdfAnnotationDataFormat.fdf); //Save the FDF file. File('export.fdf').writeAsBytesSync(bytes); - //Dispose the document + //Dispose the document. document.dispose(); {% endhighlight %} @@ -815,7 +815,7 @@ To export annotation data to the XFDF file from the PDF document, you can use th PdfDocument(inputBytes: File('input.pdf').readAsBytesSync()); //Export the annotations to XFDF file format. List bytes = document.exportAnnotation(PdfAnnotationDataFormat.xfdf); - //Save the FDF file. + //Save the XFDF file. File('export.xfdf').writeAsBytesSync(bytes); //Dispose the document. document.dispose(); @@ -835,10 +835,10 @@ To export annotation data to the JSON file from the PDF document, you can use th PdfDocument(inputBytes: File('input.pdf').readAsBytesSync()); //Export the annotations to JSON file format. List bytes = document.exportAnnotation(PdfAnnotationDataFormat.json); - //Save the FDF file. + //Save the JSON file. File('export.json').writeAsBytesSync(bytes); //Dispose the document. document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md index 6ca44eeb2f..8d4823d301 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-attachments.md @@ -1,7 +1,7 @@ --- layout: post title: Attachments in Flutter PDF library | Syncfusion -description: Learn here all about add, remove, and load the properties of file Attachments feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn here all about add, remove, and extract the properties of file Attachments feature of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -111,7 +111,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Extracting and saving an attachment to the disc +## Extracting and saving an attachment to the disk The Syncfusion® Flutter PDF provides support for extracting the attachments and saving them to the disk. The following code example explains how to extract and save an attachment. diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md index e513b9d967..4cbff61e61 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-bookmarks.md @@ -9,7 +9,7 @@ documentation: ug # Bookmarks in Flutter PDF -The Syncfusion® Flutter PDF provides support to add [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) to a PDF document to navigate interactively from one part of the document to another. It provides customization such as title font, color, size and more. It also provides support to [`insert`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/insert.html), [`remove`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/remove.html), and modify the bookmarks in an existing PDF Document. +The Syncfusion® Flutter PDF provides support to add [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) to a PDF document to navigate interactively from one part of the document to another. It provides customization such as title font, color, size and more. It also provides support to [`insert`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/insert.html), [`remove`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBookmarkBase/remove.html), and modify the bookmarks in an existing PDF document. ## Adding bookmarks to a PDF @@ -18,7 +18,7 @@ The [`PdfBookmarkBase`](https://pub.dev/documentation/syncfusion_flutter_pdf/lat {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF document +//Creates a new PDF document PdfDocument document = PdfDocument(); //Creates document bookmark @@ -30,13 +30,13 @@ bookmark.destination = PdfDestination(document.pages.add(), Offset(100, 100)); //Sets the text style bookmark.textStyle = [PdfTextStyle.bold]; -//Sets the bookmark color(RGB) +//Sets the bookmark color (RGB) bookmark.color = PdfColor(255, 0, 0); -//Save the document +//Saves the document File('Output.pdf').writeAsBytes(await document.save()); -//Dispose the document +//Disposes the document document.dispose(); {% endhighlight %} @@ -49,10 +49,10 @@ You can add a child bookmark by using the [`insert`](https://pub.dev/documentati {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF document +//Creates a new PDF document PdfDocument document = PdfDocument(); -//Add a page +//Adds a page PdfPage page = document.pages.add(); //Creates document bookmark @@ -72,16 +72,16 @@ childBookmark2.textStyle = [PdfTextStyle.italic]; childBookmark1.destination = PdfDestination(page, Offset(100, 100)); childBookmark2.destination = PdfDestination(page, Offset(100, 400)); -//Sets the bookmark color(RGB) +//Sets the bookmark color (RGB) childBookmark1.color = PdfColor(0, 255, 0); childBookmark2.color = PdfColor(0, 0, 255); -//Saves the bookmark +//Saves the document File('Output.pdf').writeAsBytes(await document.save()); -//Dispose the document +//Disposes the document document.dispose(); - + {% endhighlight %} {% endtabs %} @@ -176,8 +176,7 @@ document.dispose(); ## Modifying bookmarks in an existing PDF -The Syncfusion® - Flutter PDF allows you to modify the [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) in the existing PDF document. The following modifications can be done to bookmarks in an existing document. +The Syncfusion® Flutter PDF allows you to modify the [`bookmarks`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/bookmarks.html) in the existing PDF document. The following modifications can be done to bookmarks in an existing document. * Modify the bookmark style, color, title, and destination. * Add or insert new bookmarks into the root collection. @@ -217,4 +216,4 @@ File('output.pdf').writeAsBytes(await document.save()); document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md index bb36c9beb9..bfca662d06 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-digital-signature.md @@ -9,7 +9,7 @@ documentation: ug # Digital Signature in Flutter PDF -Flutter PDF allows you to add a digital signature to the PDF document. You can sign the PDF document internally by using a certificate with private keys or externally by using the digital signature created from various sources such as cloud services like DigitalSign. +Flutter PDF allows you to add a digital signature to the PDF document. You can sign the PDF document internally using a certificate with private keys or externally by using the digital signature created from various sources such as cloud services like DigitalSign. ## Adding a digital signature @@ -18,17 +18,17 @@ To add a digital signature, you need a certificate with private keys. The follow {% tabs %} {% highlight dart tabtitle="dart" %} -//Creates a new PDF document +//Creates a new PDF document. PdfDocument document = PdfDocument(); -//Adds a new page +//Adds a new page. PdfPage page = document.pages.add(); -//Creates a digital signature and sets signature information +//Creates a digital signature and sets signature information. PdfSignatureField field = PdfSignatureField(page, 'signature', bounds: Rect.fromLTWH(0, 0, 200, 100), signature: PdfSignature( - //Creates a certificate instance from the PFX file with a private key + //Creates a certificate instance from the PFX file with a private key. certificate: PdfCertificate(File('PDF.pfx').readAsBytesSync(), 'password123'), contactInfo: 'johndoe@owned.us', @@ -37,10 +37,10 @@ PdfSignatureField field = PdfSignatureField(page, 'signature', digestAlgorithm: DigestAlgorithm.sha256, cryptographicStandard: CryptographicStandard.cms)); -//Add a signature field to the form +//Add a signature field to the form. document.form.fields.add(field); -//Save and dispose the PDF document +//Save and dispose the PDF document. File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); @@ -117,6 +117,8 @@ document.dispose(); You can sign the PDF document from an external digital signature created from various sources such as cloud services like DigitalSign. +The `addExternalSigner` method on `PdfSignature` accepts a custom signer (an implementation of `IPdfExternalSigner`) and a list of public-certificate bytes that are used to generate the message digest to be signed. + The following code example shows how to sign the PDF document from an external signature. {% tabs %} @@ -148,10 +150,10 @@ You can create an external digital signature with the [`x509`](https://pub.dev/p **Add dependency** -Add this to your package's pubspec.yaml file. +Add the following dependency to your `pubspec.yaml` file and then run `flutter pub get`. {% tabs %} -{% highlight dart tabtitle="dart" %} +{% highlight yaml tabtitle="yaml" %} dependencies: x509: ^0.1.4 @@ -167,12 +169,14 @@ dependencies: import 'package:x509/x509.dart' as x509; {% endhighlight %} +{% endtabs %} You can compute the signed message digest by using the x509 package with a corresponding private key of the public certificate. +{% tabs %} {% highlight dart %} -//Class for singing a PDF document externally. +//Class for signing a PDF document externally. class PdfExternalSigner extends IPdfExternalSigner { //Hash algorithm. @override @@ -194,14 +198,14 @@ class PdfExternalSigner extends IPdfExternalSigner { {% endhighlight %} {% endtabs %} -You can use the sign method in IPdfExternalSigner for asynchronous signing. +You can use the sign method in `IPdfExternalSigner` for asynchronous signing. -N> Asynchronous signing will only work when saving the PDF document asynchronously. signSync works with synchronous and asynchronous save methods. +N> The asynchronous `sign` method only works when the PDF document is saved asynchronously (using `await document.save()`). The `signSync` method can be used with both `document.save()` and `document.saveSync()`. {% tabs %} {% highlight dart tabtitle="dart" %} - //Class for singing a PDF document externally. + //Class for signing a PDF document externally. class PdfExternalSigner extends IPdfExternalSigner { //Hash algorithm. @override @@ -223,7 +227,7 @@ N> Asynchronous signing will only work when saving the PDF document asynchronous {% endhighlight %} {% endtabs %} -## Adding multiple digital signature +## Adding multiple digital signatures You can apply one or more digital signatures to a PDF document. The following code example shows how to add multiple signatures to the PDF document. @@ -278,7 +282,7 @@ The Syncfusion® Flutter PDF supports creating long term signature N> The resulting PDF document size will be substantial because all the necessary signature information, Certificate Revocation List (CRL), and Online Certificate Status Protocol (OCSP) are embedded. -The following code example shows how to enable LTV for a signed PDF document using createLongTermValidity method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. +The following code example shows how to enable LTV for a signed PDF document using the `createLongTermValidity` method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -298,9 +302,9 @@ The following code example shows how to enable LTV for a signed PDF document usi {% endhighlight %} {% endtabs %} -## Create Long Term Validation (LTV) with public certificates data +## LTV with public certificates data -The following code example shows how to create an LTV for a signed PDF document using public certificates with the createLongTermValidity method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. +The following code example shows how to create an LTV for a signed PDF document using public certificates with the `createLongTermValidity` method in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The `publicCertificatesData` parameter accepts the chain of certificates returned by `PdfCertificate.getCertificateChain()`, and the `includePublicCertificates` flag controls whether the certificates are embedded into the signed document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -327,12 +331,13 @@ The following code example shows how to create an LTV for a signed PDF document {% endhighlight %} {% endtabs %} -## Adding a timestamp in digital signature +## Adding a timestamp in a digital signature + +Use this approach when you are creating a new digital signature and want the signature itself to carry a trusted timestamp from a `TimestampServer` (a TSA URL, with optional `userName`, `password`, and `timeOut`). -The Syncfusion® - Flutter PDF allows you to add timestamp in the digital signature of the PDF document using timestampServer property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. +The Syncfusion® Flutter PDF allows you to add a timestamp in the digital signature of the PDF document using the `timestampServer` property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. -N> Signing using TimestampServer only works when the document is saved using asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). +N> Signing using `TimestampServer` only works when the document is saved using the asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in the synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). {% tabs %} {% highlight dart tabtitle="dart" %} @@ -378,11 +383,13 @@ N> Signing using TimestampServer only works when the document is saved using asy {% endhighlight %} {% endtabs %} -## Adding a timestamp in the PDF document +## Adding a timestamp to the PDF document + +Use this approach when you need to add a trusted timestamp to a PDF document without binding it to a certificate-based signature. -You can add timestamp to the PDF document using timestampServer property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. +You can add a timestamp to the PDF document using the `timestampServer` property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. -N> Signing using TimestampServer only works when the document is saved using asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). +N> Signing using `TimestampServer` only works when the document is saved using the asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in the synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). {% tabs %} {% highlight dart tabtitle="dart" %} @@ -416,11 +423,13 @@ N> Signing using TimestampServer only works when the document is saved using asy {% endhighlight %} {% endtabs %} -## Adding a timestamp in an existing PDF document +## Adding a timestamp to an existing PDF document -You can add timestamp to the existing PDF document using timestampServer property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. +Use this approach when the document already exists and you need to attach a trusted timestamp without re-signing with a certificate. -N> Signing using TimestampServer only works when the document is saved using asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). +You can add a timestamp to the existing PDF document using the `timestampServer` property in [PdfSignature](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSignature-class.html) class. The following code example explains the same. + +N> Signing using `TimestampServer` only works when the document is saved using the asynchronous [save](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/save.html). It is not supported in the synchronous [saveSync](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocument/saveSync.html). {% tabs %} {% highlight dart tabtitle="dart" %} @@ -450,4 +459,4 @@ N> Signing using TimestampServer only works when the document is saved using asy document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md index 459e64835e..a963bc2c50 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-document.md @@ -18,7 +18,7 @@ You can choose the standard or custom page size when you add a page to the PDF d {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Set the page size @@ -33,7 +33,7 @@ document.pages.add().graphics.drawString( //Save and dispose the PDF document File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); - + {% endhighlight %} {% endtabs %} @@ -42,7 +42,7 @@ You can create a PDF document with custom page size by using the following code {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Set the page size @@ -53,19 +53,19 @@ document.pages.add().graphics.drawString( 'Hello World!!!', PdfStandardFont(PdfFontFamily.helvetica, 19), brush: PdfBrushes.mediumVioletRed); -//Save and close the PDF document +//Save and dispose the PDF document File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); - + {% endhighlight %} {% endtabs %} -You can change the page [`orientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageSettings/orientation.html) from [`portrait`] to landscape using the [`PdfPageOrientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageOrientation.html) enum by the following code snippet. +You can change the page [`orientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageSettings/orientation.html) from portrait to landscape using the [`PdfPageOrientation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageOrientation.html) enum by the following code snippet. {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Set the page size @@ -80,10 +80,10 @@ document.pages.add().graphics.drawString( brush: PdfBrushes.mediumVioletRed, bounds: const Rect.fromLTWH(170, 100, 0, 0)); -//Save and close the PDF document +//Save and dispose the PDF document File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); - + {% endhighlight %} {% endtabs %} @@ -92,13 +92,13 @@ You can also change the [`orientation`](https://pub.dev/documentation/syncfusion {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Set the page size document.pageSettings.size = PdfPageSize.a4; -//Change the page orientation to 90 degree +//Change the page orientation to 90 degrees document.pageSettings.rotate = PdfPageRotateAngle.rotateAngle90; //Draw the text by adding page to the document @@ -107,10 +107,10 @@ document.pages.add().graphics.drawString( brush: PdfBrushes.mediumVioletRed, bounds: const Rect.fromLTWH(170, 100, 0, 0)); -//Save and close the PDF document +//Save and dispose the PDF document File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); - + {% endhighlight %} {% endtabs %} @@ -121,22 +121,22 @@ PDF [`sections`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Add a section to PDF document PdfSection section = document.sections!.add(); -//Draw the text by section page graphics +//Draw the text on the section page graphics section.pages.add().graphics.drawString( 'Hello World!!!', PdfStandardFont(PdfFontFamily.helvetica, 27), brush: PdfBrushes.mediumVioletRed, bounds: const Rect.fromLTWH(170, 100, 0, 0)); -//Save and close the PDF document +//Save and dispose the PDF document File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); - + {% endhighlight %} {% endtabs %} @@ -157,11 +157,11 @@ document.fileStructure.incrementalUpdate = false; //Set the compression level document.compressionLevel = PdfCompressionLevel.best; -//Saves the document +//Save the document File('output.pdf').writeAsBytes(await document.save()); -//Disposes the document +//Dispose the document document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md index b3f0ef4625..07b61f0d53 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-flow-layout.md @@ -1,7 +1,7 @@ --- layout: post title: Flow layout in Flutter PDF library | Syncfusion -description: Learn here all about drawing images, paragraph text, header text and tables using Flow layout feature of Syncfusion Flutter non-UI PDF library and more. +description: Learn here all about drawing images, paragraph text, header text and tables using Flow layout feature of Syncfusion Flutter non-UI PDF library. platform: document-processing control: PDF documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Flow layout in Flutter PDF -The Syncfusion® Flutter PDF supports creating a PDF document with flow model by maintaining the position of previously drawn element. +The Syncfusion® Flutter PDF supports creating a PDF document with flow model by maintaining the position of the previously drawn elements. ## Flow model using PdfLayoutResult @@ -42,7 +42,7 @@ PdfLayoutResult layoutResult = textElement.draw( page.getClientSize().height))!; //Assign header text to PdfTextElement -textElement.text = 'Top 5 sales stores'; +textElement.text = 'Top 3 sales stores'; //Assign standard font to PdfTextElement textElement.font = PdfStandardFont(PdfFontFamily.helvetica, 14, @@ -70,7 +70,7 @@ row2.cells[0].value = 'E02'; row2.cells[1].value = 'Thomas'; row2.cells[2].value = '\$10,500'; PdfGridRow row3 = grid.rows.add(); -row3.cells[0].value = 'E02'; +row3.cells[0].value = 'E03'; row3.cells[1].value = 'Simon'; row3.cells[2].value = '\$12,000'; @@ -86,4 +86,4 @@ File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md index 8b85ad5e7e..640eb56d39 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-forms.md @@ -9,7 +9,7 @@ documentation: UG # Forms in Flutter PDF -An interactive form sometimes referred to as an AcroForm is a collection of fields for gathering information. A PDF document can contain any number of fields appearing on any combination of pages, all that makes a single, globally interactive form spanning the entire document. +An interactive form sometimes referred to as an AcroForm is a collection of fields for gathering information. A PDF document can contain any number of fields appearing on any combination of pages, all of which makes a single, globally interactive form spanning the entire document. ## Creating a new PDF form @@ -299,7 +299,7 @@ File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} -### Adding the check Box field +### Adding the check box field You can create the check box field in PDF forms using the PdfCheckBoxField class. @@ -340,7 +340,7 @@ final PdfDocument document = // Create a check box form field and add it to the existing document. document.form.fields.add(PdfCheckBoxField( - document.pages.add(), 'CheckBox', Rect.fromLTWH(100, 200, 70, 45), + document.pages[0], 'CheckBox', Rect.fromLTWH(100, 200, 70, 45), highlightMode: PdfHighlightMode.push, borderStyle: PdfBorderStyle.dot, borderColor: PdfColor(230, 0, 172), @@ -373,7 +373,7 @@ document.form.fields.add(PdfSignatureField(document.pages.add(), 'Sign', bounds: Rect.fromLTWH(100, 100, 100, 50))); //Save the PDF document. -File('output.pdf').writeAsBytesSync(document.save()); +File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} @@ -456,9 +456,9 @@ File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} -## Set appearance to the PDF form fields +## Setting appearance to the PDF form fields -After filling the form fields in the PDF document, it may appear empty due to the absence of the appearance dictionary. By setting the setDefaultAppearance method in PdfForm class to false, you can create the appearance dictionary. By this, the text will be visible in all PDF Viewers. +After filling the form fields in the PDF document, it may appear empty due to the absence of the appearance dictionary. By setting the setDefaultAppearance method in PdfForm class to true, you can create the appearance dictionary. By this, the text will be visible in all PDF Viewers. The following code sample explains how to set appearance to the PDF form fields. @@ -511,7 +511,7 @@ File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} -Retrieving or Modifying the fore, border, and back color of an existing form field +### Retrieving or modifying the fore, border, and back color of an existing form field You can retrieve or modify the fore, border, and background color of existing form fields in a PDF document by using the foreColor, borderColor, and backColor properties of the respective form fields. The following code sample explains this. @@ -653,7 +653,7 @@ File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} -### Enumerate the form fields +### Enumerating the form fields All the form fields are maintained in the PdfFormFieldCollection class. You can enumerate the fields from this form field collection and fill them. @@ -703,7 +703,7 @@ document.form.fields.add(PdfTextBoxField( text: 'toType', isPassword: true, spellCheck: true)); //Save the PDF document. -File('output.pdf').writeAsBytesSync(document.save()); +File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} @@ -748,7 +748,7 @@ document.form.fields.add(PdfTextBoxField( text: 'toType', isPassword: true, spellCheck: true)); //Save the PDF document. -File('output.pdf').writeAsBytesSync(document.save()); +File('output.pdf').writeAsBytesSync(await document.save()); {% endhighlight %} {% endtabs %} @@ -801,9 +801,9 @@ File('output.pdf').writeAsBytesSync(await document.save()); Flutter PDF supports auto naming of form fields in a PDF document while creating form fields with the same name. The fieldAutoNaming property of PdfForm is used to enable or disable auto naming of a form field. -While enabling this property, the field names are auto naming. If the fields are created using the same or common name, the created fields will act as an individual. +While enabling this property, the field names are auto-named. If the fields are created using the same or common name, the created fields will act as an individual. -While disabling this property, the field names are not auto naming, and the created fields are saved in a single group. The same value will be referred in all the same name fields. +While disabling this property, the field names are not auto-named, and the created fields are saved in a single group. The same value will be referred in all the same name fields. By default, the value is set to true. This is explained in the following code sample. @@ -935,7 +935,7 @@ File('output.pdf').writeAsBytesSync(await document.save()); ## Importing XML file to PDF -XML stands for an extensible markup language. The XML file is used to save the form data that can be imported into a PDF document. You can import the JSON file to PDF using the importData method available in the ['PdfForm'](#) class. +XML stands for an extensible markup language. The XML file is used to save the form data that can be imported into a PDF document. You can import the XML file to PDF using the importData method available in the ['PdfForm'](#) class. The following code sample explains how to import XML files to PDF. @@ -1044,7 +1044,7 @@ document.dispose(); Sometimes, Form fields may appear empty in an adobe reader due to the absence of the appearance dictionary. To resolve this, you need to enable the Adobe Reader default appearance by using the setDefaultAppearance method in PdfForm class. -The following code explains how to enable the default appearance in a new PDF document. +The following code explains how to enable the default appearance in an existing PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md index 90714757fb..78d4d7bfb0 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-headers-and-footers.md @@ -1,7 +1,7 @@ --- layout: post title: Headers and Footers in Flutter PDF library | Syncfusion -description: Learn here all about drawing Headers and Footers feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn all about drawing Headers and Footers feature of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -9,13 +9,13 @@ documentation: ug # Headers and Footers in Flutter PDF -The Flutter PDF supports drawing the header and footer in PDF document using [`PdfPageTemplateElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageTemplateElement-class.html) class. The header and footer contain the graphics support and automatic field support to perform their operations. +The Flutter PDF supports drawing the header and footer in a PDF document using [`PdfPageTemplateElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageTemplateElement-class.html) class. The header and footer support graphics and automatic fields to perform various operations. -## Adding graphics and automatic fields to header and footer +## Adding graphics and automatic fields to the header and footer -This package supports to add page count, page numbers, date and time using automatic fields such as [`PdfPageCountField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageCountField-class.html), [`PdfPageNumberField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageNumberField-class.html) and [`PdfDateTimeField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDateTimeField-class.html), and more. +This package supports adding page count, page numbers, date and time using automatic fields such as [`PdfPageCountField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageCountField-class.html), [`PdfPageNumberField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPageNumberField-class.html) and [`PdfDateTimeField`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDateTimeField-class.html), and more. -The following code snippet explains how to use the graphics and automatic fields in header and footer. +The following code snippet explains how to use the graphics and automatic fields in the header and footer. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -34,7 +34,7 @@ PdfDateTimeField dateAndTimeField = PdfDateTimeField( dateAndTimeField.date = DateTime(2020, 2, 10, 13, 13, 13, 13, 13); dateAndTimeField.dateFormatString = 'E, MM.dd.yyyy'; -//Create the composite field with date field +//Create the composite field with a date field PdfCompositeField compositefields = PdfCompositeField( font: PdfStandardFont(PdfFontFamily.timesRoman, 19), brush: PdfSolidBrush(PdfColor(0, 0, 0)), @@ -65,7 +65,7 @@ PdfPageCountField count = PdfPageCountField( font: PdfStandardFont(PdfFontFamily.timesRoman, 19), brush: PdfSolidBrush(PdfColor(0, 0, 0))); -//set the number style for page count +//Set the number style for page count count.numberStyle = PdfNumberStyle.upperRoman; //Create the date and time field @@ -79,7 +79,7 @@ dateTimeField.date = DateTime(2020, 2, 10, 13, 13, 13, 13, 13); //Sets the date and time format dateTimeField.dateFormatString = 'hh\':\'mm\':\'ss'; -//Create the composite field with page number page count +//Create the composite field with page number and page count PdfCompositeField compositeField = PdfCompositeField( font: PdfStandardFont(PdfFontFamily.timesRoman, 19), brush: PdfSolidBrush(PdfColor(0, 0, 0)), @@ -110,6 +110,6 @@ document.dispose(); {% endhighlight %} {% endtabs %} -By executing the above code sample, you will get the PDF document as follows. +By executing the above code sample, you will get the PDF document as shown below. -![Header and Footer PDF](images/working-with-headers-and-footers/header-and-footer.png) +![Header and Footer PDF](images/working-with-headers-and-footers/header-and-footer.png) \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md index 5b64a116e5..fb7a1712e0 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-hyperlinks.md @@ -9,7 +9,7 @@ documentation: ug # Hyperlinks in Flutter PDF -In PDF, hyperlinks can be added to allow the users to navigate to another part of a PDF file and web page. +In PDF, hyperlinks can be added to allow the users to navigate to another part of a PDF file or a web page. ## Working with Web navigation @@ -25,7 +25,7 @@ PdfDocument document = PdfDocument(); //Create and draw the web link in the PDF page PdfTextWebLink( - url: 'www.google.co.in', + url: 'https://www.google.co.in', text: 'google', font: PdfStandardFont(PdfFontFamily.timesRoman, 14), brush: PdfSolidBrush(PdfColor(0, 0, 0)), @@ -46,7 +46,7 @@ document.dispose(); ## Working with internal document navigation -To allow the users navigate to any other part of the same document, the [`PdfDocumentLinkAnnotation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocumentLinkAnnotation-class.html) class can be used. +To allow users to navigate to any other part of the same document, the [`PdfDocumentLinkAnnotation`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfDocumentLinkAnnotation-class.html) class can be used. The following code explains how to add the hyperlink for internal document navigation. diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md index 97f8b6ef45..5addbd8cbf 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-images.md @@ -1,7 +1,7 @@ --- layout: post title: Images in Flutter PDF library | Syncfusion -description: Learn here all about draw raster images and applying transparency and rotation to the images feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn how to draw raster images and apply transparency and rotation using the Syncfusion Flutter PDF non-UI library. platform: document-processing control: PDF documentation: ug @@ -9,9 +9,9 @@ documentation: ug # Images in Flutter PDF -Images are supported through the [`PdfImage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfImage-class.html) class, which is an abstract base class that provides functionality for [`PdfBitmap`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) class. +Images are supported through the [`PdfImage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfImage-class.html) class, which is an abstract base class that provides functionality for the [`PdfBitmap`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) class. -## Inserting an image in PDF document +## Inserting an image in a PDF document The following raster images are supported in Flutter PDF: @@ -62,7 +62,7 @@ PdfPage page = document.pages.add(); //Save the current graphics state PdfGraphicsState state = page.graphics.save(); -//Translate the coordinate system to the required position +//Translate the coordinate system to the required position page.graphics.translateTransform(20, 100); //Apply transparency @@ -89,9 +89,9 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Inserting image to PDF using a web URL +## Inserting an image to a PDF using a web URL -The ['PdfBitmap'](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) API accepts List and base64 string as inputs, so you can retrieve the image from the web URL as base64 or List and assign it to the bitmap class. +The [`PdfBitmap`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBitmap-class.html) API accepts `List` and base64 string as inputs, so you can retrieve the image from the web URL as `List` (or base64) and assign it to the bitmap class. Steps to insert an image to the PDF using Web URL: 1. Add **http** package to the dependencies section of the **pubspec.yaml** file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md index 387bd5aff8..65f1fa6626 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-layers.md @@ -65,7 +65,7 @@ File('output.pdf').writeAsBytes(await document.save()); {% endhighlight %} {% endtabs %} -The following code shows how to add the multiple layers in an existing PDF document. +The following code shows how to add a layer to an existing PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -101,7 +101,7 @@ File('output.pdf').writeAsBytes(await document.save()); ## Toggling the visibility of layers -The visibility of a layer can be mentioned while creating a new page layer. +The visibility of a layer can be specified while creating a new page layer. The following code shows how to toggle the visibility of layers in a new PDF document. @@ -136,7 +136,7 @@ File('output.pdf').writeAsBytes(await document.save()); ## Removing layers from an existing PDF document -You can remove the layers from the layer collection represented by the [`PdfPageLayerCollection`](#) of the loaded page. This is showed in the following code sample. +You can remove the layers from the layer collection represented by the [`PdfPageLayerCollection`](#) of the loaded page. This is shown in the following code sample. {% tabs %} {% highlight dart tabtitle="dart" %} diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md index 62c9110dd0..da041ca826 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-lists.md @@ -1,7 +1,7 @@ --- layout: post title: Bullets and Lists in Flutter PDF library | Syncfusion -description: Learn here all about add ordered and unordered lists feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn here all about adding ordered and unordered lists features of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -9,7 +9,7 @@ documentation: ug # Bullets and Lists in Flutter PDF -The Syncfusion® Flutter PDF allows you list the content in ordered and unordered list. The ordered list can be number or alphabets and the unordered list can be bullets, circles, and images. +The Syncfusion® Flutter PDF allows you to list the content in ordered and unordered list. The ordered list can be number or alphabets and the unordered list can be bullets, circles, and images. ## Adding an ordered list @@ -76,7 +76,7 @@ document.dispose(); ## Adding a sub list -The Syncfusion® Flutter PDF also provides support to create a sub list to a [`PdfList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfList-class.html). A sub list can be created under both [`PdfOrderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfOrderedList-class.html) and [`PdfUnorderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfUnorderedList-class.html). The following code snippet explains the same. +The Syncfusion® Flutter PDF also provides support to create a sub list in a [`PdfList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfList-class.html). A sub list can be created under both [`PdfOrderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfOrderedList-class.html) and [`PdfUnorderedList`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfUnorderedList-class.html). The following code snippet explains the same. {% tabs %} {% highlight dart tabtitle="dart" %} diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md index deaba3983a..56df6dd059 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-pages.md @@ -1,7 +1,7 @@ --- layout: post title: Pages in Flutter PDF library | Syncfusion -description: Learn here all about add, rotate pages and customize page settings feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn about adding and rotating pages and customizing page settings in the Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -16,7 +16,7 @@ The following code sample explains how to add a [`PdfPage`](https://pub.dev/docu {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Create a new PDF page and draw the text @@ -46,7 +46,7 @@ PdfDocument document = document.pages.insert(0); //Saves the document -File('output.pdf').writeAsBytes(await document.save()); +File('Output.pdf').writeAsBytes(await document.save()); //Disposes the document document.dispose(); @@ -62,7 +62,7 @@ You can add [`margin`](https://pub.dev/documentation/syncfusion_flutter_pdf/late {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Set margin for all the pages @@ -71,10 +71,11 @@ document.pageSettings.margins.all = 200; //Draw the text by adding page to the document document.pages.add().graphics.drawString( 'Hello World!!!', PdfStandardFont(PdfFontFamily.helvetica, 27), - brush: PdfBrushes.darkBlue); + brush: PdfBrushes.darkBlue, bounds: const Rect.fromLTWH(170, 100, 0, 0)); //Save and dispose the PDF document -List bytes =await document.save(); +List bytes = await document.save(); +await File('Output.pdf').writeAsBytes(bytes); document.dispose(); {% endhighlight %} @@ -150,7 +151,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Get the number of pages from a PDF document +## Getting the number of pages from a PDF document You can get the page count from the existing PDF document as shown in the following code sample. @@ -232,7 +233,7 @@ document.pages.remove(page); document.pages.removeAt(0); //Saves the document -File('output.pdf').writeAsBytes(await document.save()); +File('Output.pdf').writeAsBytes(await document.save()); //Disposes the document document.dispose(); diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md index 71e9d5d5ff..061ae4ef7f 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-conformance.md @@ -15,7 +15,7 @@ The Syncfusion® Flutter PDF currently supports the following PDF * PDF/A-2b conformance * PDF/A-3b conformance -N> To know more details about PDF/A standard refer [`https://en.wikipedia.org/wiki/PDF/A#Description`](https://en.wikipedia.org/wiki/PDF/A#Description) +N> To know more details about the PDF/A standard, refer to [PDF/A standard](https://en.wikipedia.org/wiki/PDF/A#Description) ## PDF/A-1b conformance @@ -63,7 +63,7 @@ document.dispose(); ## PDF/A-3b conformance -The PDF/A-3b conformance supports the external files as attachment to the PDF document, so you can attach any document format such as Excel, Word, HTML, CAD, or XML files. +The PDF/A-3b conformance supports external files as attachments to the PDF document, so you can attach any document format such as Excel, Word, HTML, CAD, or XML files. You can create a PDF/A-3b document by specifying the conformance level as a3b through PdfConformanceLevel enum when creating the new PDF document as follows. @@ -79,7 +79,7 @@ PdfDocument document = PdfDocument(conformanceLevel: PdfConformanceLevel.a3b) //Creates an attachment PdfAttachment attachment = PdfAttachment( 'input.txt', File('input.txt').readAsBytesSync(), - description: 'Input text', mimeType: 'application/txt') + description: 'Input text', mimeType: 'text/plain') ..relationship = PdfAttachmentRelationship.alternative ..modificationDate = DateTime.now(); @@ -93,4 +93,4 @@ File('output.pdf').writeAsBytes(await document.save()); document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md index a8115e6f8e..e553fd141b 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-pdf-templates.md @@ -1,7 +1,7 @@ --- layout: post title: Templates in Flutter PDF library | Syncfusion -description: Learn here all about add headers and footers and stamp by Templates feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn here all about adding headers, footers, and stamps using the Templates feature of the Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -9,11 +9,11 @@ documentation: ug # Templates in Flutter PDF -A PDF template is a drawing surface, where contents can be added. All the elements that can be added to a [`PdfPage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage-class.html) is supported in [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) as well. The template in turn can be drawn over the page or can be positioned at any part of the page. +A PDF template is a drawing surface, where contents can be added. All the elements that can be added to a [`PdfPage`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage-class.html) are supported in [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) as well. The template in turn can be drawn over the page or can be positioned at any part of the page. ## Creating a new PDF template -The [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) class can be used to create a new PDF template. You can add contents to the template using [`graphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage/graphics.html) property of the [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) object. +The [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) class can be used to create a new PDF template. You can add contents to the template using [`graphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate/graphics.html) property of the [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) object. The following code example explains how to add contents to the [`PdfTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTemplate-class.html) and render into the new PDF page. @@ -49,7 +49,7 @@ document.dispose(); Essential® PDF supports template creation using the [`CreateTemplate`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPage/createTemplate.html) method, enabling users to extract content from an existing PDF page and seamlessly incorporate it into a new PDF document. -The below code illustrates how to create the template from an existing page and draw it in a new PDF document. +The following code illustrates how to create the template from an existing page and draw it in a new PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -69,6 +69,8 @@ The below code illustrates how to create the template from an existing page and PdfGraphics graphics = page.graphics; //Draw the template. graphics.drawPdfTemplate(template, Offset(0, 0)); + //Dispose the loaded PDF document. + loadedDocument.dispose(); //Save and dispose of the PDF document. File('Output.pdf').writeAsBytes(await document.save()); document.dispose(); @@ -185,7 +187,7 @@ document.dispose(); ## Adding stamp to the PDF document -The Syncfusion® Flutter PDF allows you add stamp to the PDF document using PDF templates. +The Syncfusion® Flutter PDF allows you to add a stamp to the PDF document using PDF templates. The following code example explains how to draw text as a stamp to the PDF document. diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md index 1511700976..30b379cd7d 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-security.md @@ -9,7 +9,7 @@ documentation: ug # Security in Flutter PDF -Flutter PDF allows you to protect the PDF document using encryption and set permission to the PDF document operations like printing, editing, copy content etc. using user password and owner password. Two types of encryption algorithms are available +Flutter PDF allows you to protect the PDF document using encryption and set permissions for PDF document operations like printing, editing, copying content, and more using user password and owner password. Two types of encryption algorithms are available * Rivest Cipher 4 (RC4) * Advanced Encryption Standard (AES) @@ -23,7 +23,7 @@ User password: Prevents people from opening or viewing a PDF document. Once the {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Document security @@ -48,16 +48,16 @@ document.dispose(); {% endhighlight %} {% endtabs %} -N> While using both user and owner passwords, please specify different user and owner password while encrypting the PDF document for better security. +N> When using both user and owner passwords, please specify a different password for each while encrypting the PDF document for better security. You can protect the PDF document from printing, editing, copying with the [`ownerPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/ownerPassword.html) by using the following code snippet. -Owner password: Sets PDF document restrictions, which can include printing, content copying, editing, page extracting, commenting, and more. Once the owner password is set, Acrobat will require this password to make any changes to the PDF document. It further secures the PDF document to set a PDF Owner Password. +Owner password: Sets PDF document restrictions, which can include printing, content copying, editing, page extracting, commenting, and more. Once the owner password is set, Acrobat will require this password to make any changes to the PDF document. Setting a PDF owner password further secures the PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Document security @@ -91,12 +91,12 @@ document.dispose(); ## Working with AES Encryption -You can encrypt PDF document using AES algorithm with 128bit or 256bit or 256bit Revision 6 key size. The following code snippet illustrates how to encrypt the PDF document with the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html). +You can encrypt PDF document using AES algorithm with 128bit, 256bit, or 256bit Revision 6 key size by setting the [`algorithm`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/algorithm.html) to the corresponding [`PdfEncryptionAlgorithm`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfEncryptionAlgorithm.html) value (`aesx128Bit`, `aesx256Bit`, or `aesx256BitRevision6`). The following code snippet illustrates how to encrypt the PDF document with the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html). {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Document security @@ -185,9 +185,9 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Changing the password of the PDF document +## Changing the user password of the PDF document -You can change the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html) of the existing PDF document by using following code snippet. +You can change the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html) of the existing PDF document by using the following code snippet. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -206,7 +206,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Remove password from the user password PDF document +## Remove the user password from a PDF document You can remove the [`userPassword`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfSecurity/userPassword.html) from the encrypted PDF document by using the following code snippet. @@ -259,9 +259,9 @@ document.dispose(); ## How to determine whether the PDF document is protected by user or owner password? -Flutter PDF supports identifying the document whether it is protected by user or owner. +Flutter PDF supports identifying whether a document is protected by a user or owner password. -The following table shows the various combination for loading the secured document with user or owner password: +The following table shows the various combinations for loading a secured document with a user or owner password: @@ -338,4 +338,4 @@ Returns owner Password (owner password is same as the user password; it allows f -
+ \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md index 900fd82860..fd3d4f55c5 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-shapes.md @@ -180,7 +180,7 @@ document.dispose(); ### Arc -You can draw an arc in PDF document by using the [`drawArc`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics-class.html) method of [`PdfGraphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics-class.html). The following code snippet explains how to draw an arc in the new PDF document. +You can draw an arc in PDF document by using the [`drawArc`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics/drawArc.html) method of [`PdfGraphics`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGraphics-class.html). The following code snippet explains how to draw an arc in the new PDF document. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -248,4 +248,4 @@ File('Ellipse.pdf').writeAsBytes(await document.save()); document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md index 0db94dc49a..4db03b733b 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-tables.md @@ -1,7 +1,7 @@ --- layout: post title: Tables in Flutter PDF library | Syncfusion -description: Learn here all about draw and customize cells, rows, and columns in Tables feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn here all about drawing and customizing cells, rows, and columns in Tables feature of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -13,7 +13,7 @@ The Syncfusion® Flutter PDF provides support for creating customi ## Creating a table -[`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) allows you to create table by entering the data manually. +[`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) allows you to create a table by entering the data manually. The following code example explains how to create a table directly using [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) with [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html), [`PdfGridColumn`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridColumn-class.html) and [`PdfGridRow`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridRow-class.html) classes. @@ -29,10 +29,10 @@ PdfGrid grid = PdfGrid(); //Add the columns to the grid grid.columns.add(count: 3); -//Add header to the grid +//Add a header to the grid grid.headers.add(1); -//Add the rows to the grid +//Add the header to the grid PdfGridRow header = grid.headers[0]; header.cells[0].value = 'Employee ID'; header.cells[1].value = 'Employee Name'; @@ -263,7 +263,7 @@ document.dispose(); ## Table customization in PdfGrid -Flutter PDF supports users to create a customizable PDF table like [`cellSpacing`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellSpacing.html), [`cellPadding`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellPadding.html), [`borderOverLapStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/borderOverlapStyle.html), and more. This can be achieved by using the [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html) class. +Flutter PDF supports users to create a customizable PDF table like [`cellSpacing`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellSpacing.html), [`cellPadding`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/cellPadding.html), [`borderOverlapStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle/borderOverlapStyle.html), and more. This can be achieved by using the [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html) class. The following code snippet explains how to customize the [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) using [`PdfGridStyle`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGridStyle-class.html). @@ -356,14 +356,14 @@ document.dispose(); ## Pagination in PdfGrid -Flutter PDF supports to paginate the [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) using the [`PdfLayoutFormat`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfLayoutFormat-class.html) class. +Flutter PDF supports paginating the [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) using the [`PdfLayoutFormat`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfLayoutFormat-class.html) class. The following sample explains how to allow [`PdfGrid`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfGrid-class.html) to flow across pages. {% tabs %} {% highlight dart tabtitle="dart" %} -//Create a new PDF documentation +//Create a new PDF document PdfDocument document = PdfDocument(); //Create a PdfGrid diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md index 8f7c0c0878..1ef5c03abd 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-text-extraction.md @@ -1,7 +1,7 @@ --- layout: post title: Text extraction in Flutter PDF library | Syncfusion -description: Learn here all about different types of fonts and draw Text feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn how to extract or find text from PDF pages using the Syncfusion Flutter PDF library with simple, practical code examples and more. platform: document-processing control: PDF documentation: ug @@ -15,7 +15,7 @@ The Syncfusion® Flutter PDF allows you to extract or find the tex You can extract the text from pages using the extractText method in the PdfTextExtractor class. -The following code explains how to extract the text from the entire PDF document: +The following code sample explains how to extract the text from the entire PDF document: {% tabs %} {% highlight dart tabtitle="dart" %} @@ -33,7 +33,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -The following code sample explains how to extract the texts from a specific page: +The following code sample explains how to extract the text from a specific page: {% tabs %} {% highlight dart tabtitle="dart" %} @@ -51,7 +51,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -The following code sample explains how to extract the texts from a particular page range: +The following code sample explains how to extract the text from a particular page range: {% tabs %} {% highlight dart tabtitle="dart" %} @@ -114,7 +114,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -### Working with words +### Working with Words You can get a single word and its properties by using the TextWord. Refer to the following code sample. @@ -162,7 +162,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -### Working with characters +### Working with Characters You can get a single character and its properties by using the TextGlyph. Refer to the following code sample. @@ -213,7 +213,7 @@ document.dispose(); {% endhighlight %} {% endtabs %} -## Working with find text +## Working with Find Text You can find a collection of text from pages using the findText method in the PdfTextExtractor class. You can get the text and its properties using the MatchedItem. @@ -287,4 +287,4 @@ List textCollection = PdfTextExtractor(document).findText( document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md index 768dd4de82..51bfb5777e 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-text.md @@ -1,7 +1,7 @@ --- layout: post title: Text drawing in Flutter PDF library | Syncfusion -description: Learn here all about Text extraction and find text feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn all about the text drawing feature of the Syncfusion Flutter PDF non-UI library with simple, practical code examples and more. platform: document-processing control: PDF documentation: ug @@ -71,9 +71,9 @@ The Syncfusion® Flutter PDF allows you to add text to the PDF doc ### Draw text using standard fonts -PDF has fourteen base fonts also known as standard fonts, which has special significance. The details can be referred from the link below. +PDF has fourteen base fonts also known as standard fonts, which have special significance. The details can be referred from the link below. -[`Standard type 1 fonts`](https://en.wikipedia.org/wiki/PDF#Standard_Type_1_Fonts_.28Standard_14_Fonts.29) +[`Standard type 1 fonts`](https://en.wikipedia.org/wiki/PDF#Standard_Type_1_Fonts_(Standard_14_Fonts)) You can add text using the standard PDF fonts, by initializing the [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfStandardFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfStandardFont-class.html) class. The following code snippet explains this. @@ -99,7 +99,7 @@ document.dispose(); ### Draw text using TrueType fonts -You can add text using the font data, by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) class. The font data can be loaded from the disk. The font data can be initialized to [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) as a list of bytes or base64 string format. The following code snippet explains this. +You can add text using the font data, by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) class. The font data can be loaded from the disk. The font data can be initialized to [`PdfTrueTypeFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTrueTypeFont-class.html) as a list of bytes or in base64 string format. The following code snippet explains this. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -123,7 +123,7 @@ document.dispose(); ### Draw text using CJK fonts -The Syncfusion® Flutter PDF provides support to draw a CJK (Chinese, Japanese, Korean) text using some of the standard CJK fonts. The font data can be initialized by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as PDF CJK StandardFont. The following code sample explains this. +The Syncfusion® Flutter PDF provides support to draw a CJK (Chinese, Japanese, Korean) text using some of the standard CJK fonts. The font data can be initialized by initializing [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) class as [`PdfCjkStandardFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfCjkStandardFont-class.html). The following code sample explains this. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -147,7 +147,7 @@ document.dispose(); ## Measuring a string -The Syncfusion® Flutter PDF allows you to measure the size of a string which uses the [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) using the [`measureString`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont/measureString.html) method of it and returns the size. Refer to the following code sample. +The Syncfusion® Flutter PDF allows you to measure the size of a string which uses the [`PdfFont`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont-class.html) using the [`measureString`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfFont/measureString.html) method and returns the size. Refer to the following code sample. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -215,7 +215,7 @@ document.dispose(); ## Creating a multicolumn PDF document -Syncfusion® Flutter PDF allows you to create a multi-column text in PDF document by using [`PdfTextElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTextElement-class.html) class. The following code example explains the same. +Syncfusion® Flutter PDF allows you to create a multi-column text in a PDF document by using [`PdfTextElement`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfTextElement-class.html) class. The following code example explains how to draw text in multiple columns. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -300,13 +300,13 @@ File('Output.pdf').writeAsBytes(await document.save()); //Disposes the document document.dispose(); - + {% endhighlight %} {% endtabs %} -## Draw text with Pens and Brushes +## Drawing text with pens and brushes -Pens and brushes are used to draw the content on PDF document with specific color and style. +Pens and brushes are used to draw the content on a PDF document with specific color and style. {% tabs %} {% highlight dart tabtitle="dart" %} @@ -318,11 +318,11 @@ final PdfDocument document = PdfDocument(); document.pages.add().graphics.drawString( 'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 20), brush: PdfSolidBrush(PdfColor(0, 0, 0)), - pen: PdfPen(PdfColor(255, 0, 0), width : 0.5), + pen: PdfPen(PdfColor(255, 0, 0), width: 0.5), bounds: const Rect.fromLTWH(0, 0, 500, 50)); //Save the document -final List bytes =await document.save(); +File('Output.pdf').writeAsBytes(await document.save()); //Dispose the document document.dispose(); @@ -330,4 +330,4 @@ document.dispose(); {% endhighlight %} {% endtabs %} -The Syncfusion® Flutter PDF has [`Pens`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPens-class.html) and [`Brushes`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBrushes-class.html) with various built-in colors to draw the content on PDF document. \ No newline at end of file +The Syncfusion® Flutter PDF has [`Pens`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfPens-class.html) and [`Brushes`](https://pub.dev/documentation/syncfusion_flutter_pdf/latest/pdf/PdfBrushes-class.html) with various built-in colors to draw the content on a PDF document. \ No newline at end of file diff --git a/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md b/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md index aea556cd11..c647e4b57e 100644 --- a/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md +++ b/Document-Processing/PDF/PDF-Library/flutter/working-with-watermarks.md @@ -1,7 +1,7 @@ --- layout: post title: Watermarks in Flutter PDF library | Syncfusion -description: Learn here all about add text and image Watermarks feature of Syncfusion Flutter PDF non-UI library and more. +description: Learn all about adding text and image watermarks feature of Syncfusion Flutter PDF non-UI library and more. platform: document-processing control: PDF documentation: ug @@ -13,7 +13,7 @@ The Syncfusion® Flutter PDF provides support for adding watermark ## Adding text watermark to a PDF document -The Syncfusion® Flutter PDF allows you draw the text watermark to the PDF document using graphics elements. +The Syncfusion® Flutter PDF allows you to draw the text watermark to the PDF document using graphics elements. The following code example explains how to draw the text watermark to the PDF document. @@ -85,4 +85,4 @@ File('SampleOutput.pdf').writeAsBytes(await document.save()); document.dispose(); {% endhighlight %} -{% endtabs %} +{% endtabs %} \ No newline at end of file