仅打印可见屏幕 [英] print visible screen only

查看:139
本文介绍了仅打印可见屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个html应用程序运行在IE6(是的,它必须是6的暂时),目前我打印的应用程序的页面/报告。此报告是所有html,只使用内置打印功能的浏览器。它当前跨越更多的1页,即滚动,并且打印功能打印整个页面,即使是不可见的。

I have an html application running in IE6(yes it has to be 6 for the time being), currently I print a page/report of the application. This report is all html and just uses the browsers built in print functionality. It currently spans more that 1 page i.e. scrolls, and the printing functionality prints the whole page, even what is not visible.

我有问题,可以只打印页面的可见部分。因此,如果用户滚动,我只打印用户当前看到的,没有别的?

The question I have, is it possible to print only the visible part of the page. So if the user scrolls, I only print what the user is currently seeing, and nothing else?

推荐答案

欺骗,我想。

您可以尝试以下操作。我没有尝试,但它可能工作:

You could try the following. I haven't tried it out but it might work:


  • 给身体和HTML标签100%高度

  • 给身体一个overflow:hidden

  • 将页面的内容放入100%宽,100%高的DIV中,溢出:auto

  • 滚动到所需的位置,然后点击打印

  • Give the body and the HTML tag 100% height
  • Give the body a "overflow: hidden"
  • Put the contents of your page into a 100% wide, 100% tall DIV with overflow:auto
  • Scroll to the desired position and click "print"

仅可见部分。没有保证,虽然。如果你尝试,让我知道它是如何工作的。

it might give you the visible portion only. No guarantees, though. If you try it, let me know how it works out.

这篇关于仅打印可见屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆