Code Monkey home page Code Monkey logo

Comments (7)

deepakfbd1989 avatar deepakfbd1989 commented on July 18, 2024 1

< a href="./ViewerJS/#data:application/pdf;base64,JVBERi0xLjQxxxxx..." >

can you show me the code

I got:
about:blank#blocked

error with the following code,, Here encodedString is a base64 string;:
href="./ViewerJS/#data:application/pdf;base64,<% out.println(encodedString);%>"

from viewerjs.

thz avatar thz commented on July 18, 2024

you mean by providing the pdf blob as a data-uri? where do you see the base64 data?

from viewerjs.

shahzain-blur avatar shahzain-blur commented on July 18, 2024

Well the server is sending me a base64 encoded string of the PDF instead of the actual path to the PDF document (don't ask why, I don't know myself). So i'm using a function to convert the base64 to uint8Array. And then I call PDFJS.getDocument(uint8Array). So in the viewer implementation, it's taking the href src from an a tag, so I was just wondering if there's a way to instead use that string. Thanks.

from viewerjs.

thz avatar thz commented on July 18, 2024

In general: yes

  • it will require small API changes to feed a blob instead of URL

from viewerjs.

arviiiiind avatar arviiiiind commented on July 18, 2024

Hi @thz , Is this enhancement is implemented in latest version of viewer.js

from viewerjs.

myke94 avatar myke94 commented on July 18, 2024

Hi,

I wonder how should we build the link with a base64 encoded document
I did a test like this
[code] < a href="./ViewerJS/#< encoded_file_string >" > [/code]
But it does not work

Thanks.

from viewerjs.

myke94 avatar myke94 commented on July 18, 2024

I tried with this code:
[code] < a href="./ViewerJS/#data:application/pdf;base64,JVBERi0xLjQxxxxx..." > [/code]
It works in Firefox, but not in Chrome.
Is this the right code used?

Thanks.

from viewerjs.

Related Issues (20)

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.