简体   繁体   English

出现水平滚动条时,无法打印页面的全部内容

[英]Unable to Print the full content of Page when horizontal scroll bar appears

I need to print the current page in the asp.net application for that I am using javascript:window.print() . 我需要在asp.net应用程序中打印当前页面,因为我正在使用javascript:window.print()

It's working fine when the page content is within the bounds. 当页面内容在范围内时,它工作正常。 However, if the horizontal scrollbar appears as a result of overflow, am able to print only the visible content while the overflown contents couldn't be printed. 但是,如果水平滚动条是由于溢出而出现的,则只能打印可见的内容,而不能打印溢出的内容。

Is there any workaround to get this working? 有任何解决方法可以使此工作正常进行吗? Is there any other alternative apart from javascript to achieve this functionality? 除了JavaScript以外,还有其他替代方法可以实现此功能吗?

you can continue using javascript. 您可以继续使用javascript。 however, try embedding this in the <head> section of your markup: 但是,请尝试将其嵌入到标记的<head>部分中:

<style type="text/css" media="print">
    #yourDivIdHere{width: 90%; overflow:auto;}
</style>

hope that works! 希望有效!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM