Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8064937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:30:40+00:00 2026-06-05T11:30:40+00:00

[ Simplified version of this question: ] Why do iFrames sometimes refuse to print?

  • 0

[Simplified version of this question:]

Why do iFrames sometimes refuse to print? For example, hit print preview on these two pages:

  1. http://fiddle.jshell.net/gJDv4/1/show/
  2. http://fiddle.jshell.net/gJDv4/2/show/

On print-preview, the iFrames are visible in the first example, but hidden in the second. The ONLY code difference between first and second iFrames is a CSS property (margin: 20px;) has been added to the iFrames in the second example.


[Long (original) version:]

I am building a preview/print page that assembles a bunch of independent HTML files referencing their own style-sheets and javascript files.

  • http://jsfiddle.net/GJKkm/16/

The idea is that all files are displayed in iFrames for preview, and then when printed, each iFrame (which likely will span multiple pages) prints out as if it were it’s own document.

However, when I print (or print-preview) the iFrames either show no content, or they only print the first page, truncating the remaining pages of the iFrame.

  • http://fiddle.jshell.net/GJKkm/16/show/ (use this link to print-preview, not the one above)

The iFrames printed (and print-previewed) just fine before I made them multiple pages:

  • http://fiddle.jshell.net/GJKkm/7/show/

What is the reason for this behavior?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:30:41+00:00Added an answer on June 5, 2026 at 11:30 am

    You can print the documents in the individual iframes by calling the print() function on their windows….

    So something like this to print file 2:

    $('#iframeTwo')[0].contentWindow.print()
    

    And here a jsfiddle where I added buttons which trigger the individual prints…

    http://jsfiddle.net/sg3s/GJKkm/17/

    As for why the browser doesn’t print the content inside iframes when printing their parent document. Probably has to do something with the fact that those documents aren’t actually part of the document they’re shown in… Think of it like a separate window (one you may generate with window.open() in js) but then skillfully hacked into the main document with the viewport limited to whatever is specified on the iframe with some magic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a simplified version of my question earlier today since I didn't get
I was trying to make a simplified version of my code for this question
I'm re-asking this question in a simplified and expanded manner. Consider these sql statements:
So this is the simplified version of the data file: Wichita, KS[3769,9734]279835 308 1002
So this is the simplified version of the data file: Wichita, KS[3769,9734]279835 308 1002
This is a (very) simplified version of my iPhone code : @interface x {
This is a simplified version of the problem I am trying to solve: There
I am not able to link RtlIpv4StringToAddressExW(). This is a simplified version of my
This is a simplified partial version of my code to demonstrate the issue: function
My question is very similar to these two: C# component events? C# - writing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.