25

I'm experiencing an issue when printing pages containing multiple iFrames, when the contents of the iFrame are longer than the printed page, it doesn't display properly.

Here is a super boiled down version of what I'm seeing. Open this link, hit print preview: http://ringdev.com/code/inner.html You should see 7 pages of lorem ipsum fill.

Next open this link in IE 10, 11, or FF 38 and hit print preview: http://ringdev.com/code/outer.html You can see only the 1st page is printed. You can see the iFrame run off the bottom of the page, but it doesn't continue on to page 2 or beyond.

Interestingly, Chrome has no problems with this and prints perfectly fine. Unfortunately, the organization only supports IE and Firefox.

Anyone ever run into this before, or have any ideas with how to resolve it?

dqve
  • 646
  • 6
  • 18
ThatRickGuy
  • 402
  • 3
  • 13
  • 2
    Tested in IE11 and FF38, Cant find any problem :/ – Jinu Kurian Nov 16 '15 at 13:30
  • Weird, just now got the notification of your response. Tested again in Microsoft Edge, still does not print correctly. I don't have FF installed on this machine, but I'll give it another try on Monday. – ThatRickGuy Feb 28 '16 at 17:31
  • 2
    Yes, I could reproduce it in IE11 latest version, Windows 8.1 when printing to a PDF file. Only 1 page is printed. I actually got 2 pages, the second one is blank. Been dealing with iframes and IE11 lately that's why I stumbled across your post. – Valdez V. Mar 02 '16 at 03:03
  • I think `page-break-inside: initial` is uncommon, and would hazard a guess that this is a browser-level bug. Is there a technical reason you can not use `

    ` tags semantically?

    – Phil Ricketts Oct 25 '16 at 14:27
  • Have you tried to set up print styles css making all your iframes no scrolling and full length of the text you want to print? – dreamweaver Feb 01 '17 at 20:33
  • No problem for me in IE 11 – decadenza May 05 '17 at 09:22
  • 2
    I recall many issues with trying to print web pages with iframes in IE. If you find a successful method, by all means go for it, but I would quit while you're ahead and try to load and print just the iframe content in a window by itself. – scunliffe Jun 23 '17 at 18:36
  • Strange, I can see all 7 pages in IE 11 when clicking print preview. Is there a more specific build number you can provide for your IE version? Which OS is that? I'm using Windows 8.1. – Tomer Shay Jul 06 '17 at 12:37
  • 2
    @ThatRickGuy: Broken links in your question mate – garfbradaz Jul 25 '17 at 12:39
  • If both pages are on the same domain, for all the iframes, you can simply pass the iframe id in the src so your code would look like and on inner.html you would have + "').height=document.clientHeight"> – ullfindsmit Nov 04 '17 at 17:48
  • Using JavaScript, have you tried instructing the browser to print the iframe by its URL, rather than printing both the main frame and iframe. I would imagine you cannot print an entire iframe content incase the iframe contains reems and reems of data that the user or viewer is not aware of in a clear manner, specially given that iframes can be resized to almost invisible dimensions, and would deceive the user if they clicked print and 5000 pages were being sent over to the printer instead of what the user perceived to be 1 or 2 pages – DataCure Dec 09 '19 at 10:30

1 Answers1

1

I would look for a windows update that could be your problem. There is a security update for CVE-2017-8529 that will break the printing of iFrame pages. KB4022725 is one such update.

Not only do you want to see if the update is installed, but also check the registry for the following registry keys:

`SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_PRINT_INFO_DISCLOSURE_FIX\iexplore.exe

SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ENABLE_PRINT_INFO_DISCLOSURE_FIX\iexplore.exe`

Make sure they are disabled.

Here is where you can find the information from Microsoft on the issues this updated and iFrames have in relation to each other:

support.microsoft.com

forkdbloke
  • 1,505
  • 2
  • 12
  • 29