GithubHelp home page GithubHelp logo

Comments (18)

pauldmps avatar pauldmps commented on August 16, 2024

What you wrote seems to be incomplete. Would you complete it ?

from android-pdf.js.

ericlentz avatar ericlentz commented on August 16, 2024

Forgot the backtick markup on the script tag and it didn't show up. Should be complete now.

from android-pdf.js.

pauldmps avatar pauldmps commented on August 16, 2024

No, still not visible.

from android-pdf.js.

ericlentz avatar ericlentz commented on August 16, 2024

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.

pauldmps avatar pauldmps commented on August 16, 2024

Oh .okay, my bad. I got it now. Will update with your suggestions as soon as possible.

from android-pdf.js.

stefan89 avatar stefan89 commented on August 16, 2024

@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.

ericlentz avatar ericlentz commented on August 16, 2024

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.

pauldmps avatar pauldmps commented on August 16, 2024

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.

pauldmps avatar pauldmps commented on August 16, 2024

I pushed the required changes. Please check now.

from android-pdf.js.

stefan89 avatar stefan89 commented on August 16, 2024

@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.

stefan89 avatar stefan89 commented on August 16, 2024

@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.

pauldmps avatar pauldmps commented on August 16, 2024

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.

pauldmps avatar pauldmps commented on August 16, 2024

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.

stefan89 avatar stefan89 commented on August 16, 2024

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.

pauldmps avatar pauldmps commented on August 16, 2024

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.

stefan89 avatar stefan89 commented on August 16, 2024

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.

pauldmps avatar pauldmps commented on August 16, 2024

It has something to do with different how versions of webview handles HTML5. I would rather ask in Google support.

from android-pdf.js.

anandraj16992 avatar anandraj16992 commented on August 16, 2024

Can you provide complete code for how to implement new library of pdf Viewer ?

from android-pdf.js.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.