FROM:http://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Convert-HTML-to-PDF-with-New-Plugin.html

Converting HTML to PDF with C# PDF component is so important that we always try our best to improve our Spire.PDF better and better. We aim to make it is much more convenient for our developers to use. Now besides the previous method of converting HTML to PDF offered by Spire.PDF, we have a new plugin for html conversion to PDF. This section will focus on the new plugin of convert HTML to PDF. With this new plugin, we support to convert the HTML page with rich elements, such as HTTPS, CSS3, HTML5, JavaScript.

You need to download Spire.PDF and install it on your system, add Spire.PDF.dll as reference in the downloaded Bin folder thought the below path '..\Spire.PDF\Bin\NET4.0\Spire.PDF.dll'. And for gain the new plugin, you could get the new plugin from the download file directly: HTMLConvertor-0.2.3.3.zip

You need to unzip the convertor plugin package and copy the folder 'plugins' under the same folder of Spire.Pdf.dll.

C# HtmlToPdf.zip and VB.NET HtmlToPdfVB.zip, you could download and try it.

Calling the plugins is very simple, please check the below C# code for convert HTML to PDF.

using System.Drawing;
using Spire.Pdf.Graphics;
using Spire.Pdf.HtmlConverter.Qt; namespace SPIREPDF_HTMLtoPDF
{
class Program
{
static void Main(string[] args)
{
HtmlConverter.Convert("http://www.wikipedia.org/", "HTMLtoPDF.pdf", //enable javascript
true, //load timeout
* , //page size
new SizeF(, ), //page margins
new PdfMargins(, ));
System.Diagnostics.Process.Start("HTMLtoPDF.pdf");
}
}
}

如果出现异常

The conversion provider cann't be found.
Please make sure:
1. the folder "plugins" under the same folder of Spire.Pdf.dll
2. exists "plugins\HTMLConverter.dll" and other "plugins\*.dll

首先把IIS里web对应的应用程序池,高级设置里改成32位模式

其次要安装

Microsoft Visual C++ 2010 Redistributable Package (x86)

最新文章

  1. File system needs to be upgraded. You have version null and I want version 7
  2. jQuery导航切换功能
  3. Android Canvas绘图详解(图文)
  4. 描述了say_hello函数的具体内容,调用zend_printf系统函数在php中打印字符串
  5. 嵌入式 H264参数语法文档: SPS、PPS、IDR以及NALU编码规律
  6. Strom实现数字累加Demo
  7. 关于http状态码204理解
  8. 监听手机晃动(摇一摇)SensorEventListener
  9. Bash的数组
  10. [2014-08-18]初尝 AspNet vNext On Mac
  11. 【Java学习笔记之四】java进制转化
  12. Homework:工作日 还是周末
  13. Vmware Workstation _linux yum 仓库搭建
  14. hashCode()方法和equal()方法的区别
  15. zope.interface 库学习一
  16. 机器人meta标签和X-Robots-Tag HTTP标头规格
  17. IntelliJ IDEA总是提示Cannot resolve symbol
  18. React(0.13) 定义一个动态的组件
  19. php大数除法保留精度问题
  20. 添加react-router

热门文章

  1. Hadoop体系结构之 HDFS
  2. Linux安装微信
  3. java使用array.copy复制数组
  4. 1111 Online Map
  5. angular 本地存储
  6. Cassandra学习六 一些知识点
  7. linux命令echo和cat比较
  8. U-boot分析与移植(2)----U-boot stage1分析
  9. Python实现SSH连接远程服务器
  10. temp4