使用 wkhtmltopdf 或任何其他免费工具的 C# html 到 pdf 转换器 [英] C# html to pdf converter using wkhtmltopdf or any other free tools

查看:71
本文介绍了使用 wkhtmltopdf 或任何其他免费工具的 C# html 到 pdf 转换器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 C# 中将 html 转换为 pdf 的完美工具是什么??我通过 stackoverflow.com 找到了 wkhtmltopdf.但它不工作.在命令行中转换www.google.com"时显示此消息.

What is the perfect tool for converting html to pdf in C# ?? I have found wkhtmltopdf through stackoverflow.com . But its not working . showing this message in time of converting "www.google.com" in command line.

C:\Program Files\wkhtmltopdf>wkhtmltoimage.exe www.google.com go.pdf

C:\Program Files\wkhtmltopdf>wkhtmltoimage.exe www.google.com go.pdf

加载页面(1/2)

渲染(2/2)

错误:无法保存图片

完成

我也下载了 EO.pdf ,但不确定如何通过 C# 或命令行使用它.只需要一个简单的工具和 C# 指南,它可以将 html 从 url 或 html soruce 转换为 pdf.提前致谢

I have also downloaded EO.pdf , but not sure how to use it through C# or command line. Just want a simple tool and guideline in C# which can convert html to pdf from url or html soruce . thanks in advance

推荐答案

您的问题是您正在尝试使用 wkhtmltoimage.exe 生成 PDF.使用 wkhtmltopdf.exe 代替,你应该没问题.

Your issue is that you are attempting to use wkhtmltoimage.exe to generate a PDF. Use wkhtmltopdf.exe instead and you should be fine.

C:\Program Files\wkhtmltopdf>wkhtmltopdf.exe www.google.com go.pdf

就您的问题而言,我真的不相信有完美的工具.不过,我对 wkhtmltopdf 非常 满意.

As far as your question, I don't really believe that there is a perfect tool. I have been very satisfied with wkhtmltopdf however.

这篇关于使用 wkhtmltopdf 或任何其他免费工具的 C# html 到 pdf 转换器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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