20

When I try to print the webpage, only the frame appears in the print when using IE or other browsers. However, through the google chrome, the whole page gets printed.

I have done a little research and found out that adding the OpenFrame plugin would do the trick. However, I am looking for the solution without the plugins. Our product is used by a number of customers and we can't ask them to install any plugins.

Can we fix this by making CSS changes or scripts.

Justin Cave
  • 227,342
  • 24
  • 367
  • 384
Praveen Narsipur
  • 201
  • 1
  • 2
  • 5

9 Answers9

28

Using JavaScript you can print frames independently, e.g.

top.frames[1].print()

If you include a print button or listen to print events, you can call your print function that prints only the frame you want.

Or you can use CSS @media print to set what gets printed

Denes Papp
  • 3,835
  • 3
  • 32
  • 33
16

Highlight (select) what you want to print, right-click over the selected area and hit print.

p.s.: No other option worked. The add-on (Chrome app) doesn't have a print option, only open in new window and by doing so it sends a new page request and for many sites it won't work.

Joao Leme
  • 9,598
  • 3
  • 33
  • 47
6

The best way is to use this "Chrome App" to add a Context sub-menu to your Chrome.

After the installation right click on the frame you want to print, select [This Frame] and the select the option that fits the best with your situation, usually [Open Frame in New tab]. Once you have the frame in a new tab you simply print it with CTRL-P or Right-Click [Print].

Community
  • 1
  • 1
FrancoSF
  • 532
  • 5
  • 17
1
@media print { .div-to-not-print {display:none}}

is problematic because

  1. It's not an end-user solution; it has to be done by the page developer, and
  2. We're talking about frames, which are actually independent pages. That sort of solution wouldn't allow a user to print two frames independently.

The suggestion

Click on the File > Print , then use the option Simplify Page

may work in some circumstances, but, for me, it just removes all frames and reverts to the <noframe> content in the frameset page.

As far as I can tell, there is no decent way to print just one frame in a frameset that is already loaded. A Chrome plugin that I haven't tried called "Print This Frame" really just re-loads the frame in a new tab (with a round-trip to the server).

But, without that plugin, if the frame you want to print was created from a hyperlink within the frameset, you can usually load the frame in a separate tab or window just by right-clicking on that link and selecting "Open link in new tab" or "Open link in new window"

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
Robin Richmond
  • 146
  • 1
  • 5
0

Well the only workaround I could suggest is to open the source of the page and find the section

clink on the link and print it.

Snake Sanders
  • 2,641
  • 2
  • 31
  • 42
0

You should be using CSS:

@media print { .div-to-not-print {display: none} }

In the print version the blocks with class div-to-not-print will be hidden.

Ujjwal Singh
  • 4,908
  • 4
  • 37
  • 54
0

I found one another option useful.

Click on the File > Print , then use the option Simplify Page , that does removes useless things from page.

It might not be relevant to specific page you are printing. But i use it often.

user2230605
  • 2,390
  • 6
  • 27
  • 45
0

Facing the same problem, I found that the most convenient way to control exactly what I wanted to print, thus remove the adds and various elements that just waste paper was to edit the page source directly:

  • Inspect the page : Ctrl-Shift-I -> this opens a pane with the source code of the page and the layout
  • By hover'ing over the source code it is really quick to identify the interesting elements that you are interested in, just remove the other ones:
    • it is a hierarchical representation of the page layout so you can expand the and elements to have more granularity when hover'ing
    • you may need to change or remove the class of the elements to change the internal layout if you have removed internal columns for example

Here is an example: enter image description here

Louis Caron
  • 1,043
  • 1
  • 11
  • 17
-2
  1. Click on the frame of interest
  2. press CTRL+A (on Windows or equivalent on Mac) to select all content of the frame
  3. press CTRL+P or choose print from the context menu

This should show a preview with everything in the frame ready to be saved as PDF or printed to the printer.

Oleg Melnikov
  • 3,080
  • 3
  • 34
  • 65