首页 > 代码库 > Pdf相关
Pdf相关
1、CPechkin
PdfDemo.z01.zip
PdfDemo.z02.zip
PdfDemo.zip
http://files.cnblogs.com/files/Idus/PdfDemo.z02.zip
需要把z01.zip、z02.zip后缀去掉
GlobalConfig config = new GlobalConfig();
SimplePechkin pechkin = new SimplePechkin(config);
ObjectConfig objectConfig = new ObjectConfig();
objectConfig.SetPrintBackground(true)
.SetLoadImages(true)
.SetAffectPageCounts(true)
.SetPageUri("http://www.baidu.com");//此处替换为你的uri
byte[] bytePDF = pechkin.Convert(objectConfig);//此处亦支持html字符串
File.WriteAllBytes("D:\\PDFName.pdf", bytePDF);
SynchronizedPechkin sc = new SynchronizedPechkin(new GlobalConfig().SetMargins(new Margins(100, 100, 100, 100)));
IList<Uri> uris = new List<Uri> {
new Uri(@"http://www.baidu.com"),
new Uri(@"http://www.baidu.com")
};
byte[] buf = sc.Convert(uris);
string fn = Path.GetTempFileName() + ".pdf";
FileStream fs = new FileStream(fn, FileMode.Create);
fs.Write(buf, 0, buf.Length);
fs.Close();
2、ITextSharp
http://www.cnblogs.com/zuochengsi-9/p/5483808.html
HTML转PDF组件集锦
3、PDF File Writer
.NET平台开源项目速览(16)C#写PDF文件类库PDF File Writer介绍
Pdf相关