Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Germany
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print iFrame Content

    Does anybody of u know how to print the content of an iFrame? The Content of the iFrame is just another HTML Page!!!

    Thanx and Cheers,
    Sepp

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    344
    Thanks
    0
    Thanked 0 Times in 0 Posts
    right click in the IFrame and select "Print"

    this will print the page inside the iframe.


    Alternately you could have a button that says "click here to print" or something like that... try this:

    In the page that's inside the iframe put this:

    Code:
    <a href="#" onClick="print(); return false;">click here to print this page</a>
    that should work.

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Germany
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    reply

    don't want to put it INSIDE the iFrame!!!!

    That's my problem!

    Thanx anyway!

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    344
    Thanks
    0
    Thanked 0 Times in 0 Posts
    whoa, settle down!!!

    Explain exactly what you want to do then...

    ~Quack

  • #5
    Regular Coder
    Join Date
    May 2002
    Location
    Helsinki, Finland
    Posts
    231
    Thanks
    0
    Thanked 1 Time in 1 Post

    Thumbs up

    Brief:
    Code:
    <script type="text/javascript">
    function zPrint(oTgt)
    {
    	oTgt.focus();
    	oTgt.print();
    }
    </script>
    
    .
    .
    .
    <body>
    	<iframe name="myFrame" id="myFrame" width="600" height="400" src="about:mozilla></iframe>
    	<input type="button" value="Print IFRAME" onclick="zPrint(myFrame);" />
    </body>
    Zvona
    First Aid for
    Web Design

  • #6
    New to the CF scene
    Join Date
    Jun 2002
    Location
    Germany
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I exactly wanted to do what ZVONA did offer me!!!!
    Thanx man

  • #7
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What if I only want my frame to be printed if I press ctrl+p or if I choose print in the menu, how can I do that?

  • #8
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Zvona View Post
    Brief:
    Code:
    <script type="text/javascript">
    function zPrint(oTgt)
    {
    	oTgt.focus();
    	oTgt.print();
    }
    </script>
    
    .
    .
    .
    <body>
    	<iframe name="myFrame" id="myFrame" width="600" height="400" src="about:mozilla></iframe>
    	<input type="button" value="Print IFRAME" onclick="zPrint(myFrame);" />
    </body>


    How could you fix same csolution using this code? for me it doesn´t work
    I wanna print pictures iframe from the header iframe
    <div id="wrapper">
    <div id="header">
    <iframe id="header" src="header.html" ></iframe>

    </div>
    <div id="content">
    <iframe id="pictures" src="arm001.html" Scrolling="no"> </iframe>

    </div>
    <div id="footer"><iframe id="footer" src="footer.html" > </iframe></div>
    </div>
    </body>
    check the look here:
    http://www.pixelperu.net/iframe/iframe.jpg

  • #9
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have used above to print a pdf document in an iframe successfully on firefox, but it doesn't seem to work on IE8. The print dialog comes up, but nothing prints.

    Anybody else experienced this, or know how to make it work.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •