Comments (18)
What you wrote seems to be incomplete. Would you complete it ?
from android-pdf.js.
Forgot the backtick markup on the script tag and it didn't show up. Should be complete now.
from android-pdf.js.
No, still not visible.
from android-pdf.js.
As Forest Gump would say, "And that's all I have to say about that." Perhaps it is the way in which I ended what I had to say or maybe the page is cached for you? The script tag example applies to 3 lines which can be found in the index.html file.
I believe I have outlined pretty thoroughly the changes I made. There are some gaps for someone to fill in, but I believe I've put in enough markers to get them to their destination. If you have any specific questions, ask away.
from android-pdf.js.
Oh .okay, my bad. I got it now. Will update with your suggestions as soon as possible.
from android-pdf.js.
@ericlentz could you upload a working copy of your solution. I can't get it work using your explanation.
I still get a white blank view when running on Android 4.2
I would love to get it work with older versions than Android 4.4
from android-pdf.js.
I can't just upload a copy as it is not my code, it is a client's. I would suggest that you start simple by skipping the dynamic part initially and just adding an actual filename that exists. Experiment with filename paths until you get output. If you get that working, then my solution is simple as it is just a matter of making the hardcoding dynamic.
If you want to post your code here or link to a pastebin or some such service, I can try to see if I can offer suggestions.
from android-pdf.js.
Sorry for the delay. I was busy & could not update the code. I'll push the changes in 1-2 days.
from android-pdf.js.
I pushed the required changes. Please check now.
from android-pdf.js.
@ericlentz thanks for your response. First I'll try the updated version from pauldmps.
@pauldmps Great! Unfortunately I am currently busy and not able to test your updated code. I will try your update within a few days and let you know if it solved the problem.
from android-pdf.js.
@pauldmps finally I was able to test your updated code.
What I want to accomplish is to download a pdf file from the internet and open it within the app.
I changed your PdfViewer.java to:
http://pastebin.com/dqDkyuE2
And I added the following line to the AndroidManifest.xml file:
Could you see why it doesn't work properly? I see a blank web view when testing it. Tested on Android 4.0 and higher
from android-pdf.js.
By blank page, do you mean absolutely blank or does the webview shows up with the HTML but the pdf is not rendered?
from android-pdf.js.
If it is the latter, I recommend that you upgrade to the latest version (or probably beta version) of pdf.js & compatibility.js from Mozilla's Github repo.
from android-pdf.js.
Thanks for your quick response. I mean absolutely blank (completely white screen).
I just tested the same code (I sent yesterday) with the new js files you recommended but still no success. (Same result)
Versions I tested with:
Stable v1.0.712
Beta v1.0.907
from android-pdf.js.
So its related to webview not loading on your device. Maybe you can try on any other device or ask at Google dev forums. I do not have a 4.0 device to test so can't help you much.
from android-pdf.js.
Now it works fine. The webview is able to open a pdf file on Android 4.1
Unfortunately it does not work with every PDF file. With most PDF files I only see the text "Page .. / .." in the left corner but no PDF.
On Android 4.4 it does work with every PDF file I tested (same files as I tested with Android 4.1)
Any ideas? I already tested with different versions of the js files (stable and beta)
from android-pdf.js.
It has something to do with different how versions of webview handles HTML5. I would rather ask in Google support.
from android-pdf.js.
Can you provide complete code for how to implement new library of pdf Viewer ?
from android-pdf.js.
Related Issues (11)
- Does not work on Android 4.3 HOT 6
- blurry HOT 9
- Not Working HOT 7
- Select text not working HOT 1
- Always starts at first page of PDF HOT 1
- Android - pdf. js works on local pdf file HOT 1
- Showing "Page: /" on white page HOT 2
- PDFJS.getDocument Uncaught TypeError: undefined is not a function
- Only first page is getting displayed
- Quality of pdf is very low
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 android-pdf.js.