question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IE11 print margins in iFrame

See original GitHub issue

Outside to iFrame, and with outher browsers it’s all ok! Into IE11 iframe not.

<iframe src="http://mozilla.github.io/pdf.js/web/viewer.html"></iframe>

Configuration:

  • Web browser and its version: IE11
  • Operating system and its version: WIN 10
  • PDF.js version: 1.7.225
  • Is an extension: -

Steps to reproduce the problem:

  1. Open the official demo page in a iframe with IE11
  2. Print

Print outside iframe: image

Print into iframe: image

Wrong: image

Could you help me? thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
k-odecommented, Feb 27, 2017

While I’m not entirely sure why, IE11 (and older version of IE) has issues with using window.print in an iframe. Using window.document.execCommand('print', false, null); seems to get the desired results, but is not supported in Firefox.

If you are building pdf.js from source, you can change print.call(window) in pdf_print_service.js to this:

if (document.queryCommandSupported('print')) {
  window.document.execCommand('print', false, null);
} else {
  print.call(window);
}

For a more complete solution, you might also want to check if you are in an iframe.

0reactions
timvandermeijcommented, Nov 9, 2019

Closing IE11/Edge (non-Chromium-based) issues in response to #11211. Please note that, as outlined in https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support, only bugs which completely prevent the library and/or the default viewer from running will be accepted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IE11 Printing website loses lines at the bottom of every page
Made sure overlow was always visible; changing margins in print preview of IE11; Removed all styles entirely and there was still cutoff from ......
Read more >
float | CSS-Tricks
The float property in CSS is used for positioning and layout on web pages. A common usage might be floating an image to...
Read more >
iFrame Resizer - GitHub Pages
Listen for resize events from the parent page, or the iFrame. Select the 'child' value if the iFrame can be resized independently of...
Read more >
IE 11 - Post June 2017 Update - Cannot print iframe
When our users are printing from in our application, they are unable to print the iframed content they are viewing.
Read more >
Firefox & IE creating extra page when printing - HTML & CSS
There are no blank pages for me in Chrome/FF33/IE11. The second page htat prints out only have two paragraphs on it so is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found