Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Printing does not work #4

Closed
antoinepairet opened this issue Feb 12, 2016 · 5 comments
Closed

Printing does not work #4

antoinepairet opened this issue Feb 12, 2016 · 5 comments

Comments

@antoinepairet
Copy link
Contributor

Thanks for making angular-pdfjs-viewer. It looking great.

There seems to be an issue with printing. PDF.js complains when calling renderProgress, it crashes because the template is lacking 2 divs:

  1. printContainer
  2. mozPrintCallback-shim

The renderProgress function searches the mozPrintCallback-shim, but cannot find it. It is null and

Crash:
var progressContainer = document.getElementById('mozPrintCallback-shim'); is null...
One cannot call querySelector on it.
screen shot 2016-02-13 at 00 10 46

Original viewer template:
screen shot 2016-02-13 at 00 07 12

Is the solution as simple as adding the missing divs to the template?

@antoinepairet
Copy link
Contributor Author

It might be as simple as updating the viewer.html in your vendor folder (not on GitHub).
see: https://github.com/legalthings/angular-pdfjs-viewer/blob/master/Gruntfile.js#L21

@moesjarraf
Copy link
Member

Yes I believe updating the viewer.html file should solve the problem. As you can see here the piece of code in your screenshot is missing in our viewer file. Could you test if the problem is solved by adding that snippet of code below <!-- outerContainer -->? If it fixes it, feel free to make a pull request at https://github.com/legalthings/pdf.js-viewer

@kegster
Copy link

kegster commented Apr 1, 2016

I'm having this issue as well with chrome and FF. The viewer.html that I downloaded from your responses here still is missing those dis.

I've added the divs myself but I don't see them showing up.

@moesjarraf
Copy link
Member

It should be fixed now after running a bower update in your project.

@kegster
Copy link

kegster commented Apr 1, 2016

This solution partially fixed the problem. While the print button now works, it doesn't do a nice print of the document only. It shows as if someone tried to print the website.

Any ideas?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants