Need to print only the frame and not the whole page using Google Chrome
Asked Answered
L

9

21

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.

Loss answered 14/11, 2011 at 3:28 Comment(0)
H
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

Hausner answered 4/1, 2014 at 14:23 Comment(0)
S
18

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.

Skilful answered 29/10, 2015 at 14:34 Comment(0)
S
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].

Stealthy answered 18/4, 2013 at 21:40 Comment(2)
Really wish this was baked into ChromePseudonymous
link is now 404Mccarron
F
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"

Flin answered 5/4, 2016 at 3:15 Comment(0)
A
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.

Alisiaalison answered 29/1, 2013 at 14:40 Comment(0)
F
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.

Fideism answered 10/5, 2013 at 15:51 Comment(0)
G
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.

Gallardo answered 28/3, 2016 at 21:50 Comment(0)
L
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

Levitical answered 10/7, 2021 at 15:4 Comment(0)
T
-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.

Terrilynterrine answered 31/10, 2021 at 19:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.