直接转换成的.aspx以.PDF [英] Directly convert .aspx to .pdf

查看:143
本文介绍了直接转换成的.aspx以.PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个项目,需要我建立一个报告,该报告以HTML(的.aspx)输出为PDF。是否有解决方案可用,让我一个.aspx页面的输出馈送到PDF生成工具? HTML和CSS的全力支持将是理想的。

A project I am working on requires me to build a report that is output in both HTML (.aspx) and as a PDF. Is there a solution available that allows me to feed the output of an .aspx page to a PDF generation utility? Full support of HTML and CSS would be ideal.

谢谢!

推荐答案

wkhtmltopdf 将做到这一点....用法

wkhtmltopdf will do it.... USAGE:

wkhtmltopdf http://www.google.com google.pdf

这是它。你可以到任何网页...即使ASPX。因为它使用WebKit的HTML渲染引擎(Safari浏览器,Chrome浏览器)的CSS支持比任何其他工具更好。享受

That is it. You can go to any web page... even aspx. css is supported better than any other utility as it uses the webkit html rendering engine (Safari, Chrome). Enjoy

有是可以从净简单地通过使用的Process.Start使用单个.exe(7 mb)个
请确保您复制EXE到你的项目目录,或者你必须指定完整路径。
例如:

There is a single .exe (7 mb) that can be used from .Net simply by using Process.Start Make sure that you copy the exe into your project directory or you have to specify the full path. ex:

static void HtmlToPdf(string website,string destinationFile)
    {
        ProcessStartInfo startInfo = new ProcessStartInfo();
        startInfo.FileName = "wkhtmltopdf.exe";
        startInfo.Arguments = website+" "+destinationFile;
        Process.Start(startInfo);
    }  

我认为SSL支持,但我不认为2路SSL将在时刻工作。这是手下来最好的单,止损HTML - > PDF工具,我已经看到了

I think SSL is supported but I do not think that 2-way SSL would work at the moment. It is hands down the best single stop HTML -> PDF tool I have seen.

这篇关于直接转换成的.aspx以.PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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