GithubHelp home page GithubHelp logo

Comments (7)

moesjarraf avatar moesjarraf commented on August 17, 2024

@kegster Have you tried to run the demo that is located within this repository? That should get you started. Also judging by your screenshot it looks like the dependencies aren't being loaded in the correct order, or from the wrong directory. They should be loaded like:

<script src="{{ bower directory }}/pdf.js-viewer/pdf.js"></script>
<link rel="stylesheet" href="{{ bower directory }}/pdf.js-viewer/viewer.css">

<script src="{{ bower directory }}/angular/angular.js"></script>
<script src="{{ bower directory }}/angular-pdfjs/dist/angular-pdfjs-viewer.js"></script>
<script src="app.js"></script>

from angular-pdfjs-viewer.

kegster avatar kegster commented on August 17, 2024

The dependencies are being loaded in the order you describe.

I can't get a working demo into something outside of the demo itself.
Curious if it's meant to be placed in any div?

On Wed, Mar 30, 2016 at 6:03 PM, Moesjarraf J [email protected]
wrote:

@kegster https://github.com/kegster Have you tried to run the demo
https://github.com/legalthings/angular-pdfjs-viewer#demo that is
located within this repository? That should get you started. Also judging
by your screenshot it looks like the dependencies aren't being loaded in
the correct order, or from the wrong directory. They should be loaded like:

<script src="{{ bower directory }}/pdf.js-viewer/pdf.js"></script> <script src="{{ bower directory }}/angular/angular.js"></script> <script src="{{ bower directory }}/angular-pdfjs/dist/angular-pdfjs-viewer.js"></script> <script src="app.js"></script>


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#5 (comment)

Cris Henderson

from angular-pdfjs-viewer.

moesjarraf avatar moesjarraf commented on August 17, 2024

You may place it in a div, although that is not the problem here. If the order is correct, then it means you are not loading the dependencies from the correct directories. Could you try looking through your browser's inspector (F12 in Chrome) and check the Network tab? You can see there which files are loaded and which response they give back to you.

from angular-pdfjs-viewer.

kegster avatar kegster commented on August 17, 2024

I went ahead and loaded everything via bower and still same issue.

I have this PDF viewer loaded just fine:
https://github.com/sayanee/angularjs-pdf, using the $scope.pdfUrl ---

All I did was swap out the pdf embed code, remove the other viewer, and
then use {{ pdfUrl }} as my URL. Everything is loaded exactly as shown on
the instructions with bower.

I'm getting a "Can't interpolate: {{ pdfUrl }}" -- and now saying something
about a trusted Url source (trustAsResourceUrl or something) -- but I
didn't need this with my previous one.

Is there a reason I'm having such difficulty loading the "nicer" pdf viewer?

On Thu, Mar 31, 2016 at 6:33 AM, Moesjarraf J [email protected]
wrote:

You may place it in a div, although that is not the problem here. If the
order is correct, then it means you are not loading the dependencies from
the correct directories. Could you try looking through your browser's
inspector (F12 in Chrome) and check the Network tab? You can see there
which files are loaded and which response they give back to you.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#5 (comment)

Cris Henderson

from angular-pdfjs-viewer.

kegster avatar kegster commented on August 17, 2024

OK I implemented the trustAsResourceUrl and I'm now getting a PDF viewer,
but it's blank. the PDF won't show. It's like a blank PDF now.

Refused to get unsafe header "Accept-Ranges" is the only error i get, if it
even applies to this situation.

On Thu, Mar 31, 2016 at 9:41 AM, Cris Henderson [email protected] wrote:

I went ahead and loaded everything via bower and still same issue.

I have this PDF viewer loaded just fine:
https://github.com/sayanee/angularjs-pdf, using the $scope.pdfUrl ---

All I did was swap out the pdf embed code, remove the other viewer, and
then use {{ pdfUrl }} as my URL. Everything is loaded exactly as shown on
the instructions with bower.

I'm getting a "Can't interpolate: {{ pdfUrl }}" -- and now saying
something about a trusted Url source (trustAsResourceUrl or something) --
but I didn't need this with my previous one.

Is there a reason I'm having such difficulty loading the "nicer" pdf
viewer?

On Thu, Mar 31, 2016 at 6:33 AM, Moesjarraf J [email protected]
wrote:

You may place it in a div, although that is not the problem here. If the
order is correct, then it means you are not loading the dependencies from
the correct directories. Could you try looking through your browser's
inspector (F12 in Chrome) and check the Network tab? You can see there
which files are loaded and which response they give back to you.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#5 (comment)

Cris Henderson

Cris Henderson

from angular-pdfjs-viewer.

kegster avatar kegster commented on August 17, 2024

OK sorry for multiple messages, but trying to narrow it down and save you
time.

Right now the PDF viewer works perfectly, but the PDF is blank. Shows
correct # of pages, every page is blank, all the features work. Even the
print PDF and download PDF work (and show the whole PDF, not blank pages).

Any ideas?

I'm getting this, if it helps:
pdf.worker.js:34000 Refused to get unsafe header "Accept-Ranges"

On Thu, Mar 31, 2016 at 9:45 AM, Cris Henderson [email protected] wrote:

OK I implemented the trustAsResourceUrl and I'm now getting a PDF viewer,
but it's blank. the PDF won't show. It's like a blank PDF now.

Refused to get unsafe header "Accept-Ranges" is the only error i get, if
it even applies to this situation.

On Thu, Mar 31, 2016 at 9:41 AM, Cris Henderson [email protected] wrote:

I went ahead and loaded everything via bower and still same issue.

I have this PDF viewer loaded just fine:
https://github.com/sayanee/angularjs-pdf, using the $scope.pdfUrl ---

All I did was swap out the pdf embed code, remove the other viewer, and
then use {{ pdfUrl }} as my URL. Everything is loaded exactly as shown on
the instructions with bower.

I'm getting a "Can't interpolate: {{ pdfUrl }}" -- and now saying
something about a trusted Url source (trustAsResourceUrl or something) --
but I didn't need this with my previous one.

Is there a reason I'm having such difficulty loading the "nicer" pdf
viewer?

On Thu, Mar 31, 2016 at 6:33 AM, Moesjarraf J [email protected]
wrote:

You may place it in a div, although that is not the problem here. If the
order is correct, then it means you are not loading the dependencies from
the correct directories. Could you try looking through your browser's
inspector (F12 in Chrome) and check the Network tab? You can see there
which files are loaded and which response they give back to you.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#5 (comment)

Cris Henderson

Cris Henderson

Cris Henderson

from angular-pdfjs-viewer.

kegster avatar kegster commented on August 17, 2024

OK. I figured out the problem. I was using a different PDF viewer that wasn't as polished as yours apparently.

from angular-pdfjs-viewer.

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.