使用wpf将屏幕截图保存为pdf文件 [英] Save screen shot to pdf file using wpf

查看:116
本文介绍了使用wpf将屏幕截图保存为pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我想捕获我的屏幕,然后将其保存到不使用其他库的pdf文件。

我的解决方案是:将我的屏幕捕获到位图,然后将此位图插入excel并将此excel导出为pdf文件。



但有2个问题:

1.我将我的屏幕捕获到Bitmap但我无法将此位图插入Excel工作表。

我必须将此位图保存到图像文件,然后将此图像插入Excel工作表。

- >我想要捕获屏幕到位图并将位图添加到Excel工作表。



2.因为我的显示器分辨率很大,因此导出到pdf文件时(xlWorkSheet.ExportAsFixedFormat(。 ..))我的屏幕在pdf文件的许多页面。

- >我希望在1页PDF上捕获后显示我的屏幕(全部固定在1页)。



请帮助我。



提前感谢

Hi All,

I want to capture my screen and then save it to pdf file which don't use other library.
My solution is: capture my screen to bitmap and then insert this bitmap to excel and export this excel to pdf file.

But there are 2 issues:
1. I captured my screen to Bitmap but I can't insert this Bitmap to excel sheet.
I must save this Bitmap to image file and then insert this image to excel sheet.
-> I want capture screen to bitmap and add bitmap to excel sheet.

2. because my monitor resolution is big therefore, when export to pdf file(xlWorkSheet.ExportAsFixedFormat(...)) my screen is at many pages in pdf file.
-> I want to display my screen after captured on 1 pages of PDF(all fixed on 1 pages).

please help me.

thanks in advance

推荐答案

尝试使用iTextSharp库直接从您的代码创建PDF,而不需要任何Excel ...

http://sourceforge.net/projects/itextsharp/ [ ^ ]

这里有一些教程:

http://www.c-sharpcorner.com/Blogs/12317/add- image-in-pdf-using-itextsharp.aspx [ ^ ]

http://jwcooney.com/2013/06/09 / itextsharp-insert-an-image-to-a-pdf-in-c-sharp / [ ^ ]
Try iTextSharp library to create the PDF from your code directly without any Excel in between...
http://sourceforge.net/projects/itextsharp/[^]
Here some tutorials:
http://www.c-sharpcorner.com/Blogs/12317/add-image-in-pdf-using-itextsharp.aspx[^]
http://jwcooney.com/2013/06/09/itextsharp-insert-an-image-to-a-pdf-in-c-sharp/[^]


这篇关于使用wpf将屏幕截图保存为pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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