将网页导出为PDF [英] Exporting a web page as PDF

查看:80
本文介绍了将网页导出为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个网页,以Chart为单位显示各种参数的报告。这是一份日报。我有20张图表单个网页。现在我想要这个报告页面的截图,并从代码后面动态保存为pdf。任何人都可以通过提供解决方案或示例应用程序来帮助我。



谢谢!

Hi all,

I have a web page which shows the reports of various parameters as a Chart.It is a daywise report.I have 20 charts in a single webpage.Now I want the screenshot of this report page and save it as a pdf dynamically from code behind.Can anyone help me on this by giving a solution or a sample application.

Thanks!

推荐答案





查看以下链接...



http:// stackoverflow .com / questions / 2031717 / export-ms-charts-to-pdf-and-excel [ ^ ]



ASP.NET中的一体化导出数据 [ ^ ]


http://www.developerfusion.com/code/4630/capture-a-screen-shot/ [ ^ ]



上面的链接非常有用。我使用了上面提到的链接中的 CaptureScreen()方法并创建了图像,并将该图像传递给以下代码,创建了屏幕截图





位图位图=新位图( CaptureScreen());

图形graphics = Graphics.FromImage(bitmap as System.Drawing.Image);

graphics.CopyFromScreen(0,0,0,0,bitmap.Size);

位图。保存( c:\\screenshot.jpeg ,ImageFormat.Jpeg);



它将在路径中创建图像提到。



享受!!!
http://www.developerfusion.com/code/4630/capture-a-screen-shot/[^]

the above link is very useful.I used CaptureScreen() method from the above mentioned link and created image and passed that image to the following code which creates the screen shot


Bitmap bitmap = new Bitmap(CaptureScreen());
Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image);
graphics.CopyFromScreen(0, 0, 0, 0, bitmap.Size);
bitmap.Save("c:\\screenshot.jpeg", ImageFormat.Jpeg);

It will create the image in the path mentioned.

Enjoy!!!


这篇关于将网页导出为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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