Comments (11)
Hi, in my case, I ended up using this plugin:
https://github.com/stephanrauh/ngx-extended-pdf-viewer
Is originally designed for Angular but adapting to Ionic was not very difficult
from capacitor-docs.
@muuvmuuv sorry I've only worked with standard URL's to show a PDF that is hosted online, not local files. That "capacitor link" is unknown to me... btw did you try the plugin I suggested?
https://github.com/stephanrauh/ngx-extended-pdf-viewer
If your error is with that plugin I would suggest to look at the issues there, the creator of that plugin is really awesome and helpful
from capacitor-docs.
Hi, thanks for creating this, so is there no solution on how to simply open a pdf with an app using capacitor? I've been trying since last week with this and now I'm considering switching back this app to Cordova
from capacitor-docs.
How are you doing this in Cordova?
from capacitor-docs.
How are you doing this in Cordova?
I'm not, this is my first time working with pdf files in Ionic. But for Cordova I've found a bit more information. Right now I'm following this tutorial to see if maybe I'm lucky
https://www.youtube.com/watch?v=k2iaGNApM9w
from capacitor-docs.
Anyone made some progress here? I am also tinkering about it. But I guess opening it in the build in browser and let that one display his own PDF controls is the easisiest solution right now. I would really like to not install 4 cordova plugins do display PDF's.
from capacitor-docs.
@LuisManuel1983 how did you got it working with Capacitor urls? I mean capacitor://localhost/_capacitor_file....
. Here it just says "Unexpected server response (0) while retrieving pdf ---".
from capacitor-docs.
@LuisManuel1983 I am already using that plugin. I guess it just has something to do with pdj.js trying to parse the url different when having a custom protocol.
from capacitor-docs.
Works with Ionic & Capacitor (pdf does not load with live reload when developing, because of CORS, but works fine otherwise)
https://github.com/stephanrauh/ngx-extended-pdf-viewer can use your local capacitor// url to open locally stored files.
const uriResult = await Filesystem.getUri({
directory: Directory.Data,
path: `filename.pdf`,
});
// the path to the file
const path = uriResult.uri;
// convert to capacitor//
const localFileURL = Capacitor.convertFileSrc(path);
(you can also get the url with cordova and old ionic plugins)
from capacitor-docs.
Is there a solution for a React based Ionic App? I'm getting the error:
[Log] PDFJS.express: Development environment detected. This license key is currently registered to {mydomain} (PDFJSDocumentType.js, line 64020, x2)
The problem seems to be that capacitor://localhost isn't {mydomain} and furthermore doesn't qualify as localhost according to PDFJS.
from capacitor-docs.
Perhaps we can write a plugin that uses Swift and Kotlin native APIs to display PDF?
from capacitor-docs.
Related Issues (20)
- We should use capacitor-assets, not cordova-res, no? HOT 2
- Broken links and images for React & Angular in docs page HOT 1
- Capacitor Android Plugin Guide is outdated, it still use fn tha HOT 1
- Implement custom android plugin issue HOT 1
- Choose the name of the starting HTML file in webDir HOT 1
- The `Update kotlin_version` title in Updating plugins to 5.0 page is shown in markdown format
- capacitor run androd --l build error HOT 1
- 'Deep Links' doc may need to be updated for new Apple deeplinks API?
- Deep links: incorrect React setup documentation HOT 1
- Capacitor plugin import format outdated HOT 2
- It is available to add my own template (community)?
- feat: CapacitorCookies documentation
- Incorrect "Disable Jetifier" instruction in upgrade guide
- npx cap build docu is incomplete
- Missing Crucial Information To Send JSON Data With CapacitorHttp HOT 1
- NSLocationAlwaysUsageDescription - Deprecated HOT 5
- Usage of deprecated `getConfigValue` method for iOS platform
- Content missing for the section "Why am I getting CocoaPods errors on my Apple Silicon Device?" in Getting Started
- docs: provide information how to build a partly native plugin HOT 1
- Error with the configuration of the plugin Motion HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capacitor-docs.