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