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)

Convert HTML to PDF with New Plugin的更多相关文章

  1. [Tools] Convert SVG to a PDF in Node with PDFKit and SVG.js

    Given a epxress application and an svg template, we want to draw some text, date onto it and convert ...

  2. ImageMagick convert多张照片JPG转成pdf格式,pdfunite合并PDF文件

      在认识ImageMagick之前,我***的图像浏览软件是KuickShow,截图软件是KSnapShot,这两款软件都是KDE附带的软件,用起来也是蛮方便的.在一次偶然的机会中,我遇到了Imag ...

  3. Linux之convert命令

    Linux之convert命令 强大的convert命令 convert命令可以用来转换图像的格式,支持JPG, BMP, PCX, GIF, PNG, TIFF, XPM和XWD等类型,下面举几个例 ...

  4. 一个不错的能将HTML表格导出为excel,pdf等的jquery插件

    https://github.com/kayalshri/tableExport.jquery.plugin https://github.com/kayalshri/ tableExport.jqu ...

  5. 使用aspose.word两句代码将word转换为pdf

    //Load Document Document document = new Document(@"C:\Users\Administrator\Desktop\人事---新员工转正总结( ...

  6. Html网页生成Pdf

    在http://code.google.com/p/wkhtmltopdf/downloads/list下载安装程序. 1.添加引用 using System.Diagnostics; 添加引用 2. ...

  7. [C#] 网页Html转PDF档(一行程式码解决)

    原文 [C#] 网页Html转PDF档(一行程式码解决) 网页转PDF档做法很多( Convert HTML to PDF in .NET ) 这边纪录一下老外最多人加分的那篇做法,使用wkhtmto ...

  8. 自制 Word、Excel 批转 PDF 工具

    原文:自制 Word.Excel 批转 PDF 工具 目前做金融业的项目,该公司每天会产生很多 Word.Excel 文档,需要大量地转换为 PDF,除了自己保存外,也要给金融主管机构作为备份.由于文 ...

  9. html to pdf

    C++ Library to Convert HTML to PDF html2pdf PrinceXML 收费 CutePDF Ghostscript PDFDoc VisPDF PDFDoc Sc ...

随机推荐

  1. win7系统清除USBSTOR记录

    方法一 1.Win+R,出现运行窗口,如图所示: 2.在输入框中输入“regedit”,如图所示: 3.进入后,点击编辑-查找,查找输入框中输入“USBSTOR”(为了加快查找速度,可以只选择“项”) ...

  2. 学习FPGA需要做哪些

    有些人比较差,做了一些介绍,有误导成分.有些人水平太高,介绍的很好,但是很多人依旧听不懂,得到的肯定很少.学习FPGA,在不同层次的人明显有不同的答案. 熟悉硬件描述语言语法,不需要什么都会,但是要记 ...

  3. 进程句柄和进程ID的区别和关系

    进程和进程句柄和进程id含义 进程是一个正在运行的程序,进程里可以包括多个模块(DLL,OCX,等)进程句柄是程序访问时用到的东西,当前进程句柄等于主模块的句柄,当你使用OpenProcess时的进程 ...

  4. md5加密小程序

    #-*- coding:utf-8 -*- __author__ = "MuT6 Sch01aR" import hashlib m = hashlib.md5() m.updat ...

  5. python's thirteenth day for me 迭代器 生成器

    迭代器: for 循环可以循环的就是可迭代对象. 可迭代对象:str, list, tuple, dict, set, range. 迭代器:f1文件句柄. 可迭代协议: 可以被迭代要满足的要求就叫做 ...

  6. Python __getattribute__ vs __getattr__

    # 例子在原来的基础上简化了一下,排除依赖和干扰,详细参见原项目 class UrlGenerator(object): def __init__(self, root_url): self.url ...

  7. Java面向对象-类与对象

    Java面向对象-类与对象 类与对象的关系 我们通俗的举个例子,比如人类是一种类,张三这个人就是人类的具体的一个个体,也就是java中的对象:这就是一个类与对象的关系: 类的定义 下面看实例 类的创建 ...

  8. OCX RegSvr32 error

    [Window Title]RegSvr32 [Content]The module "tt.ocx" failed to load. Make sure the binary i ...

  9. Bootstrap 概览

    目录1.移动设备2.响应式图片3.Normalize4.Containers 1.移动设备在Bootstrap 3中,我们重写了整个框架,使其一开始就是对移动设备友好的.这次不是简单的增加一些可选的针 ...

  10. 本博文将一步步带领你实现抽屉官网的各种功能:包括登陆、注册、发送邮箱验证码、登陆验证码、页面登陆验证、发布文章、上传图片、form验证、点赞、评论、文章分页处理以及基于tronado的后端和ajax的前端数据处理。

    本博文将一步步带领你实现抽屉官网的各种功能:包括登陆.注册.发送邮箱验证码.登陆验证码.页面登陆验证.发布文章.上传图片.form验证.点赞.评论.文章分页处理以及基于tronado的后端和ajax的 ...