如何确保在所有类型的打印机上打印表单 [英] How do I ensure a form is printed on all types of printers

查看:144
本文介绍了如何确保在所有类型的打印机上打印表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个应用程序,要求我将一些表格打印到默认打印机或PDF。

在我的计算机上,代码可以成功打印到我的Epsom Stylus Photo R3000打印机或PDF Microsoft打印到PDF。

但是,当我将代码加载到其他三台笔记本电脑上时,包括我自己的笔记本电脑,这些表格都会被截断,最后几行丢失。 (打印机和PDF打印机都有)



我正在使用的代码是;

I have written an application that requires me to print some forms either to the default printer or to PDF.
On my computer the code prints successfully to my Epsom Stylus Photo R3000 printer or to PDF using Microsoft Print to PDF .
However, when I load the code onto three other laptops, including my own, the forms are printed truncated with the last few lines missing. (Both Printer and PDF Printer)

The code I am using is ;

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles PrtAvlBut.Click
        'Prints availability form when button clicked
        PrtAvlBut.Visible = False
        Array.ForEach(Me.Controls.OfType(Of TextBox).ToArray, Sub(tb As TextBox) tb.DeselectAll())
        PrintForm1.PrinterSettings.DefaultPageSettings.Margins = New System.Drawing.Printing.Margins(0, 0, 0, 0)
        PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable)

        PrtAvlBut.Visible = True
        Me.Close()
    End Sub



虽然表单清晰地显示在屏幕上,但打印预览显示要截断的表单。



我的原始代码使用ClientAreaOnly而不是Scrollable,它只打印屏幕上显示的那部分表格。由于第二个用户有一个小而低分辨率的屏幕,只有三分之二的表格是可见的,但它确实打印正确。即打印屏幕上显示的三分之二。



我不知道从哪里开始寻找解决方案。



我尝试了什么:



我测试了我的最新解决方案,屏幕分辨率设置较低,以模仿第二台用户笔记本电脑。虽然我看不到所有的表格,但它仍然打印正确,即整个表格。

我也将所有边距设置为0,以防万一这是失败的原因但是没有成功。


Although the form is clearly shown on the screen, the Print Preview shows the form to be truncated.

My original code used ClientAreaOnly instead of Scrollable, which only prints that part of the form shown on the screen. As the second user had a small and low resolution screen only two thirds of the form was visible but it did print correctly. i.e. printing the two thirds shown on the screen.

I have no idea where to start looking for a solution.

What I have tried:

I tested my latest solution with my screen resolution set lower to mimic the second users laptop. Although I could not see all of the form , it still printed correctly i.e. the whole form.
I also, set all the margins to "0", just in case this was the cause of the failure but no success.

推荐答案

需要加载一些Microsoft先决条件。

问题已关闭
Need to load some Microsoft prerequisites.
Question closed


这篇关于如何确保在所有类型的打印机上打印表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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