Comments (7)
@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.
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
<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>
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:—
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.
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.
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.
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.
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.
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)
- One document, multiple downloads HOT 2
- How to change language of the viewer? HOT 1
- Setting data attribute for the directive and filename
- CSS messes fonts defined elsewhere HOT 1
- README.md
- How can i access PdfFindController? I need to search text get the position of the text and highlight that
- Use bower postinstall after running npm install, why? HOT 7
- Go to a specific page?
- App crash when read japanese file encoding
- Unexpected server response.
- Uncaught Error: Cannot find module '../build/pdf.js' HOT 1
- Is that repo still active ?
- Error while loading the content & Invalid parameter value detected. HOT 2
- IE 11 Not working HOT 2
- Uncaught (in promise) Error: Missing PDF file. at getDocumentError HOT 1
- Rename project
- Get the total number of pages of the PDF Document
- Difference in printed documents: Chrome and IE11 HOT 1
- I have pdf viewer in modal pop up.if i use window.print for print it prints whole window but not pdf.can any help to solve this issue
- Try Applications
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 angular-pdfjs-viewer.