Skip to content

DOCINFRA-2341_merged_using_automation #350

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Flutter/pdf-viewer/bookmark-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Widget build(BuildContext context) {
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.

{% tabs %}
{% highlight dart hl_lines="24 31 32 33 34" %}
{% highlight dart hl_lines="23 31 32 33" %}

late PdfViewerController _pdfViewerController;
late PdfBookmark _pdfBookmark;
Expand Down
44 changes: 31 additions & 13 deletions Flutter/pdf-viewer/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ tag to enable the network access in your application:
<true/>
```

N> Due to CORS security restrictions in a web application, some PDFs obtained from URLs might not be loaded in the `SfPdfViewer` web platform. Kindly refer to the flutter [forum](https://github.com/flutter/flutter/issues/51125) reported on the same.

This issue can be resolved by configuring the CORS settings in the requested server or by disabling the security settings in **chrome.dart** as mentioned in the below steps:

1. Go to **flutter\bin\cache** and remove a file named: **flutter_tools.stamp**
2. Go to **flutter\packages\flutter_tools\lib\src\web** and open the file **chrome.dart**.
3. Find **'--disable-extensions'**.
4. Add **'--disable-web-security'**.

### Load document from the File

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.
Expand Down Expand Up @@ -302,26 +311,35 @@ The [onDocumentLoadFailed](https://pub.dev/documentation/syncfusion_flutter_pdfv
The [PdfDocumentLoadFailedDetails](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/latest/pdfviewer/PdfDocumentLoadFailedDetails-class.html) will return the `error` title and `description` message for the failure reason. The following code example explains the same.

{% tabs %}
{% highlight dart hl_lines="6 7 8 9 10 11 12 13 14 15 16 17 18 19" %}
{% highlight dart hl_lines="25 26" %}

/// Displays the error message.
void showErrorDialog(BuildContext context, String error, String description) {
showDialog<dynamic>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text(error),
content: Text(description),
actions: <Widget>[
TextButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: SfPdfViewer.network(
'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf',
onDocumentLoadFailed: (PdfDocumentLoadFailedDetails details) {
AlertDialog(
title: Text(details.error),
content: Text(details.description),
actions: <Widget>[
FlatButton(
child: Text('OK'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
showErrorDialog(context, details.error, details.description);
},
));
}
Expand Down
8 changes: 4 additions & 4 deletions Flutter/pdf-viewer/hyperlink-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The [SfPdfViewer](https://pub.dev/documentation/syncfusion_flutter_pdfviewer/lat

## Enable or disable the hyperlink navigation

You can enable or disable the hyperlink navigation using the `enableHyperlinkNavigation` 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. The following code example explains the same.

{% tabs %}
{% highlight dart hl_lines="9" %}
Expand All @@ -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 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 the same.

{% tabs %}
{% highlight dart hl_lines="9" %}
Expand All @@ -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` 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.

### Hyperlink clicked callback

The `onHyperlinkClicked` callback triggers when any hyperlink in the PDF document is clicked. The `PdfHyperlinkClickedDetails` will return the `uri` 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) 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.

{% tabs %}
{% highlight dart hl_lines="9 10" %}
Expand Down
4 changes: 2 additions & 2 deletions Flutter/pdf-viewer/right-to-left.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ 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` 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/widgets/Directionality/textDirection.html).

{% tabs %}
{% highlight dart hl_lines="24 25" %}
{% highlight dart hl_lines="26 27" %}

final GlobalKey<SfPdfViewerState> _pdfViewerKey = GlobalKey();

Expand Down