This repository has been archived by the owner on May 1, 2024. It is now read-only.
How to display pdf offline in Xamarin.Forms apps? #15099
Unanswered
GoldenGlitterBug
asked this question in
Q&A
Replies: 2 comments
-
For Android you can use this https://www.nuget.org/packages/XamarinLibrary.Xamarin.Android.Github.Barteksc.AndroidPdfViewer/ For iOS you can use pdfkit. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks. From online reviews it's not very efficient.
Namarata Chaturvedi
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: jingliancui ***@***.***>
Sent: Monday, February 7, 2022 10:01:19 AM
To: xamarin/Xamarin.Forms ***@***.***>
Cc: GGBG ***@***.***>; Author ***@***.***>
Subject: Re: [xamarin/Xamarin.Forms] How to display pdf offline in Xamarin.Forms apps? (Discussion #15099)
For Android you can use this https://www.nuget.org/packages/XamarinLibrary.Xamarin.Android.Github.Barteksc.AndroidPdfViewer/
For iOS you can use pdfkit.
—
Reply to this email directly, view it on GitHub<#15099 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANS6RO6JLN3MDYCWBZVW7RDUZ7UE7ANCNFSM5M3SO2CQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using PDFJS for displaying PDF files in a Xamarin.Forms apps. Copied the PDFJS folder and PDF files to the android assets folder. I am able to view/display PDFs on Android and iOS when online (connected to internet or mobile service).
But when I am offline I get following error:
"Access to XMLHttpRequest at 'file:///android_asset/abcd.pdf' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, https.", source: file:///android_asset/pdfjs/web/viewer.js
My code:
page.xaml
page.xaml.cs
PdfWebViewRenderer.cs
I am using pdf.js (https://github.com/timvandermeij/pdf.js) October 2020 version. Does this work Offline when mobile not connected to internet? My requirement is to display PDF from asset folder 'file:///android_asset/abcd.pdf' when user is Offline..
Also when I try to download the latest stable version(v2.12.313) or any other previous version I get lots of errors.
How to resolve this error or display PDF Offline in Xamarin.Forms Android and iOS apps?
Beta Was this translation helpful? Give feedback.
All reactions