View Full Version : Printing iframe from DD Tabbed doc code

04-03-2008, 08:59 AM
1) Script Title: Tabbed Document Viewer

2) Script URL (on DD): Tabbed Document Viewer

3) Describe problem:

I have added the 'print' function to a tab in my Tabbed Document Viewer code.


Having searched the code and forum sites around the net I can not get (or dont know how to use) the function to work correctly....the ability to only print what is showing in the iframe only........ in my case to exclude the header and menu.

So... the print button is in the parent window but the content is in the iframe.....

I think its something to do with this script which is a muliti iframe making the task more difficult ?

any help most appreciated.


04-03-2008, 04:07 PM
You could try (untested):

<li><a href="javascript:print();"
onclick="window.frames[0].print();return false;">Print</a></li>

04-03-2008, 05:24 PM

Works great in Firefox :)

Continues to print the menu's as well in IE unfortunately.

Much out there along the lines of this I found
But I can't seem to get any of it to work.

04-04-2008, 11:46 AM
I dont know if this helps ?
Firefox generates the top printing function box when you click the print button on my page.

IE generates the bottom one.

As fireforx prints correctly is there any chance of forcing IE to use the top type of printing 'console' ? I assume if IE did use the top one than it would also print fine...

Or are these print consoles specific to the browsers ? and not a selectable part of the OS ?


04-05-2008, 06:16 AM
Anything involving iframe content is tricky to test locally, throw in printing, and it gets even trickier, at least for me as I rarely have my printer connected and hate to waste paper.

I'm glad to see that my idea worked in FF. Now the problem in IE has nothing to do with what dialogue box it shows you. In fact, there may be no problem in IE, it may just be that you are still seeing an older cached version of the page. If so, clearing your IE browser's cache will take care of the issue.

If not, we can construct a print only stylesheet so that only the content of the iframe has display. This will be a bit tricky, so I will wait until I get the results from you as regards clearing your browser's cache in IE first.

04-05-2008, 08:50 AM
Cleared the IE complete history cookies temp / form

still printed the menu's unfortunately