Code Monkey home page Code Monkey logo

Comments (4)

jfversluis avatar jfversluis commented on May 30, 2024

Hi @leandro-chile,

Did you see the description for this in #1 ? I think that might help you :)

from pdfjs.

leonun96 avatar leonun96 commented on May 30, 2024

Hi @leandro-chile,

Did you see the description for this in #1 ? I think that might help you :)

Yes I did, but my problem is that I don't want to read a file from the assets directory, since I'm downloading it into the FileSystem.AppDataDirectory inside of a folder I created there. I tried passing the oath to the file directly into the browser with file:/// and content:// but none of that worked. looking at your code and some of the issues this is what I got:

localPath = FileSystem.AppDataDirectory + "/examenes/215/EXAMEN_MUTUAL000910.pdf";
if (Device.RuntimePlatform == Device.Android)
PdfView.Source = $"file:///android_asset/pdfjs/web/viewer.html?file={"file:///" + WebUtility.UrlEncode(localPath)}";
else
PdfView.Source = localPath;
I don't get the "Failed to fetch" error anymore but I just get the black screen with the markers of a pdfviewer like the zoom in and out buttons, the page nav, etc. The alarming thing is that i even get that screen even with a path that leads to nowhere.
Do you good sir, have any idea on how to solve this or help me in any way, I would greatly appreciate it.
Greetings.

from pdfjs.

SagarPanwala avatar SagarPanwala commented on May 30, 2024

I saw the same issue.
Fortunately I found the error from Application output.
"Uncaught ReferenceError: require is not defined", source: file:///android_asset/pdfjs/web/viewer.js
Unfortunately : I didn't find the solution.

from pdfjs.

vikgar avatar vikgar commented on May 30, 2024

Hi Gerald,
I am trying to open local file, but its unable to find. I tried putting pdf into assets library as well as Environment.GetFolderPath(Environment.SpecialFolder.Personal) which is resolving to /data/user/0/com.companyname.amcdemo/files/sample.pdf

I also made sure file in asset library is androidasset. this is the error I am getting -

with asset folder -

image

with internal storage -

image

from pdfjs.

Related Issues (6)

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.