Window.print纸张尺寸问题 [英] Window.print paper size problem

查看:1854
本文介绍了Window.print纸张尺寸问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,其实我正在开发asp.net web应用程序。它都是开发的,但有一个名为print label的部分。在本节中我有一个webform,有一个gridview

用于选择字段和相应的颜色。然后将这些fieds和颜色发送到名为printwindow.aspx的下一个表单作为参数。在这里,我将字段标签,作为参数发送到此页面,存储到表格控件中,并调用window.print来打印表单的内容。一切正常。

但问题是客户的打印机。有人抱怨打印机​​每页只打印10个标签,而每页应打印14个标签。所以,我认为这可能是由于打印机设置,例如。纵向或横向或纸张大小A4,A5,A6解决此问题,我想代码可以更改或设置客户端的打印机设置。那么,

将不需要客户更改打印机设置。

所以,请解决这个问题。



谢谢。



我的尝试:



我在谷歌寻找可以设置客户端打印机设置的代码,但我什么也没找到。

解决方案

Web应用程序无法访问客户端计算机上的设备。虽然可以请求某些设置,例如屏幕尺寸,但不能设置或更改任何设置。



我能想到的唯一解决方案是提供选项选择纸张尺寸和方向,并相应地生成页面。



不仅有页面尺寸,还有美国字母格式比A4宽5.9毫米但是缩短17.6毫米。



另请注意,许多打印机无法在整个纸张区域上打印。因此,您可以为Web表单上的边框提供选项或使用适当的默认值。


Hi dear, Actually I am working on asp.net web application. It is all developed but there is a section called print label. In this section I have a webform, there is a gridview
for selection of fields and corresponding colors. Then these fieds and colors are sent to next form called printwindow.aspx as parameters. Here I am storing labels of fields, sent to this page as parameters, into table control and making a call to window.print for print that form's content. It is all working fine.
But problem is client's printer. There is a complaint that the printer is printing only 10 labels per page while it should print 14 labels per page.So, I think that it can be due to printer settings eg. portrait or landscape or papersize A4,A5,A6 to solve this problem, I want to code that can change or set the client's printer settings. So, there
will be not any need to change printer settings by client.
So, please solve this problem.

Thanks.

What I have tried:

I am looking in google for code that can set client's printer settings but yet I found nothing.

解决方案

A web application has no access to devices on client computers. While some settings like the screen size can be requested, none can be set or changed.

The only solution for your problem that I can think of is providing an option to choose the paper size and orientation, and generate the page accordingly.

There are not only A page sizes but also the US letter format which is 5.9 mm wider than A4 but 17.6 mm shorter.

Note also that many printers can not print on the full paper area. So you might provide also options for the borders on your web form or use adequate defaults.


这篇关于Window.print纸张尺寸问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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