-
Notifications
You must be signed in to change notification settings - Fork 687
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
PDF viewer is not working with SfPdfViewer.network #1837
Comments
Hi @Talhach64, If the PDF document is loaded from the network, it is necessary that the device be connected to the internet. Also ensure that the Network permission is enabled in all the AndroidManifest.xml files (debug, main, profile).
|
Thanks for the help.
Yesterday, when I tried in production mode app it works for me. Don't know
what was the issue before maybe some kind of internet disturbance or
something.
…On Tue, Apr 30, 2024, 12:47 PM Imman Kumar ***@***.***> wrote:
Hi @Talhach64 <https://github.com/Talhach64>,
We tried to replicate the issue, and the PDF document was loaded properly
from the network. Please find the sample that we used to replicate the
issue in the attachments. Kindly check whether the document is loaded
properly with that sample.
If the PDF document is loaded from the network, it is necessary that the
device be connected to the internet.
Also ensure that the Network permission is enabled in all the
*AndroidManifest.xml* files (debug, main, profile).
<uses-permission android:name="android.permission.INTERNET"/>
image.png (view on web)
<https://github.com/syncfusion/flutter-widgets/assets/93641486/80700eb6-8c19-437b-996b-e95445620285>
pdfviewer_app.zip
<https://github.com/syncfusion/flutter-widgets/files/15160047/pdfviewer_app.zip>
—
Reply to this email directly, view it on GitHub
<#1837 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV2NQDSK7QBPSWDYGCFMS4TY75D7LAVCNFSM6AAAAABG6GWKJKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBUGYYTKNJYGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Bug description
I am using syncfusion_flutter_pdfviewer: ^25.1.41.
2 days ago I checked and it was working fine with the given example in package but now the package example is not working as well.
Moreover back when I tried it was showing loading but now its not even showing the loading bar.
Steps to reproduce
I just copied package example and tested.
Code sample
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_pdfviewer/pdfviewer.dart';
class HomePage extends StatefulWidget {
@OverRide
_HomePage createState() => _HomePage();
}
class _HomePage extends State {
final GlobalKey _pdfViewerKey = GlobalKey();
@OverRide
void initState() {
super.initState();
}
@OverRide
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Syncfusion Flutter PDF Viewer'),
actions: [
IconButton(
icon: const Icon(
Icons.bookmark,
color: Colors.white,
semanticLabel: 'Bookmark',
),
onPressed: () {
_pdfViewerKey.currentState?.openBookmarkView();
},
),
],
),
body: SfPdfViewer.network(
'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf',
key: _pdfViewerKey,
),
);
}
}
Screenshots or Video
Stack Traces
E/flutter (25377): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: ClientException with SocketException: Failed host lookup: 'cdn.syncfusion.com' (OS Error: No address associated with hostname, errno = 7), uri=https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf
E/flutter (25377): #0 NetworkPdf.getPdfBytes (package:syncfusion_flutter_pdfviewer/src/common/pdf_provider.dart:55:9)
E/flutter (25377):
E/flutter (25377): #1 SfPdfViewerState._compareDocument (package:syncfusion_flutter_pdfviewer/src/pdfviewer.dart:1318:32)
E/flutter (25377):
E/flutter (25377):
E/flutter (25377): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: ClientException with SocketException: Failed host lookup: 'cdn.syncfusion.com' (OS Error: No address associated with hostname, errno = 7), uri=https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf
E/flutter (25377): #0 NetworkPdf.getPdfBytes (package:syncfusion_flutter_pdfviewer/src/common/pdf_provider.dart:55:9)
E/flutter (25377):
On which target platforms have you observed this bug?
Android
Flutter Doctor output
Microsoft Windows [Version 10.0.19045.4291]
(c) Microsoft Corporation. All rights reserved.
C:\Users\M.Computer>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.19.4, on Microsoft Windows [Version 10.0.19045.4291], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2023.2)
[√] Connected device (4 available)
[√] Network resources
! Doctor found issues in 1 category.
C:\Users\M.Computer>
The text was updated successfully, but these errors were encountered: