打印可滚动表单 [英] Printing scrollable form

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

问题描述

我有一个可滚动的表单,我想将其完整打印.

I have a scroll-able form which I would like to print entirely.

我已经尝试使用此代码打印它:

I have already tried using this code to print it:

    Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
    Me.PrintForm.PrintAction = Printing.PrintAction.PrintToPreview
    Me.PrintForm.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable) 
End Sub

结果根本不准确.

为了演示我的问题,这里有一些照片:

To demonstrate my issue, here are some photos:

这是我想要的结果(当然我希望它也打印所有可滚动的内容)

This is the result I want (Of course I want it to ALSO print all of the scroll-able content)

如您所见,此图像包含图像所需的所有宽度,但由于它是打印屏幕图像,因此不包含我希望在可打印版本中具有的可滚动区域表格.

As you can see, This image contains all of the width I need for the image, but because it's a print screen image, it doesn't contain the scroll-able area which I would like to have in my printable version of the form.

这是我从我的代码中得到的:

and this is what I get from my code:

正如你在这里看到的,我只得到了表单宽度的 60% 和高度的 50%,很明显,我没有得到可滚动区域.

As you can see here, I only get about 60% of the form width, and 50% of the height, and clearly, I don't get the scroll-able area.

我并不关心质量,我只是希望它打印整个表单,包括可滚动区域.

I don't really care about the quality I just want it to print the whole form including the Scroll-able area.

推荐答案

我认为您的答案在 文章
您只需要参考 FormPrinting 库(或将源导入您的解决方案).

I Think your answer is in the article
All you need is to reference to FormPrinting library (or import the source to your solution).

Private Sub btnPrint_Click(object sender, EventArgs e)
        {
            var fp = new FormPrinting.FormPrinting(this);                
            fp.Print();
        }

将完成打印工作.
我已经测试了该库,对图像和...等可滚动内容没有问题.

will do the printing job.
I have tested the library, having no problems with scrollable contents like images and ....

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

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