Comments (16)
If you have the pdf file at "android/app/src/main/assets/pdf/userGuide.pdf",
you should use let source = {uri:'bundle-assets://pdf/userGuide.pdf'}
from react-native-pdf.
if you use {uri:"bundle-assets://path/to/xxx.pdf"}
you must put pdf to android folder.
like this:
android/app/src/main/assets/path/to/xxx.pdf
from react-native-pdf.
Do you mean source={require("./test.pdf")}
?
As my tested before, require a pdf at ios and android debug version can work, but android release version does not work.
You can use {uri:"bundle-assets://path/to/xxx.pdf"}
for android.
from react-native-pdf.
Thanks for the reply . Have to put pdf files in android's asset folder or i can put it anywhere.
{uri:"bundle-assets://path/to/xxx.pdf"}
here from i have pdf in my JS folder , so I have to put that pdf in android folder or i can just give the full path name
from react-native-pdf.
so we should keep two copy of pdf ?
from react-native-pdf.
In source, you can keep two copy of pdf for android and iOS,
But in built version only one copy in android or iOS app.
If you want to use one copy in source, you can keep android copy, and add it to iOS by reference.
from react-native-pdf.
i use let source = {uri:'bundle-assets://path/to/QXTTV.pdf'}; app crash error msg is /ReactNativeJS: undefined is not a function (evaluating 'l.default.fs.cp(r,n).progress(function(e,r){o.props.onLoadProgress&&o.props.onLoadProgress(e/r),o.setState({progress:e/r})})')
when i use let source = {uri:'https://www.irs.gov/pub/irs-pdf/fw2.pdf',cache:true}; it ok ,what happen? please help me think you!
from react-native-pdf.
from react-native-pdf.
source = {uri:'bundle-assets://path/to/QXTTV.pdf'};
"path/to/QXTTV.pdf" should be real assets path in your source under android/app/src/main/assets/
does it exist?
from react-native-pdf.
it s not working for me, any help?, i'm trying to make it work on android, i tried all the ways,
using:
let source = {uri:"bundle-assets://path/to/pdf-sample.pdf"}
let source = {uri:'bundle-assets://android/app/src/main/assets/pdf/userGuide.pdf'}
and in all ways didnt work,
from react-native-pdf.
i copy the exactly code from documentation i tried also doing let source = {uri:'bundle-assets://pdf/userGuide.pdf'}. My version is "react-native-pdf": "^1.0.5", "react": "15.3.2",
"react-native": "0.36.0". Can i upgrade the version of the pdf maintance the react native version?.
Thanks for the help!!
from react-native-pdf.
"uri:'bundle-assets://", was added at react-native-pdf ver 1.0.6,
so you should use ver 1.0.6+, but I do not test it with react-native <0.40.0,
I am not sure it can run or not.
you can see the detail release notes at here
from react-native-pdf.
thanks for the fast feedback I upgrade to 1.0.6 and the messaje now is "pdf has no proptype for native prop rctpdf.asset of native type string if you havent changed this prop yourself, this usually means that your versions of the native code and javascript code are out of sync. updating both should make this error go away".
If i want to use the uri:FILE:
let source = {uri:"file:////home/me//android-app/android/app/src/main/assets/pdf/userGuide.pdf"}.
How it's works?
Thanks!
from react-native-pdf.
It can not work. the "android/app/src/main/assets" is not real path in your system.
Dose it work if you use local file? like let source = {uri:"file:////sdcard/xxx/xxx.pdf"}.
from react-native-pdf.
i want to add the pdf in the App, it's here "home/me/android-app/js/components/help/userGuide.pdf".
i am trying with many ways, like:
let source = {uri:"file:////home/me/android-app/js/components/help/userGuide.pdf"}
but still now working, i need to make it works with react-native-pdf 1.0.5, because upgrading break up all my App. Thanks for all
from react-native-pdf.
show the pdf in the App need "uri:'bundle-assets://", but it seems not work.
if you can use let source = {uri:"file:////sdcard/xxx/xxx.pdf"},
You can use react-native-fetch-blob copy the asset pdf to temp path and show it.
for detail, you can see here
or my source code
from react-native-pdf.
Related Issues (20)
- Search Bar / Searching Text In PDF?
- Pdf doesnt look same in ios and android
- BUG: Scroll indicator is not visible on android
- Android build error on latest version [email protected] HOT 27
- When sliding through the PDF file, closing the current page causes the app to crash. HOT 9
- iOS New Architecture/Fabric build error: no member named 'enableDoubleTapZoom' HOT 4
- Android Crash at PDF viewing HOT 11
- "TypeError: Cannot read property 'getConstants' of null, js engine: hermes " after installing "react-native-pdf" package in expo HOT 6
- I'm tring to display pdf but PDF shows blank screen, I'm using base64 data in source HOT 1
- Tried to access a JS module before the React instance was fully set up. HOT 8
- Pdf not loading first time in Android ,gives error open failed:ENONT HOT 8
- rn 0.73.8版本,android上不显示红色盖章和姓名
- Links on iOS not working due to code change introduced with the new `enableDoubleTapZoom` option HOT 6
- HyperLinks on onPressLink is not working in IOS. HOT 11
- pdf file not fully 100% loaded... stops after 80-90% HOT 5
- Android: Does not work with any remote URL - Possible unhandled promise rejection (id: 2): Error: /data/user/... open failed: ENOENT (No such file or directory) HOT 12
- Cannot scroll inside GestureDetector on Android HOT 1
- Android crash: Segmentation violation (invalid memory reference)
- Android: Native crash app error "PDF renderer" HOT 2
- Annotations for Android 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 react-native-pdf.