Aspose公司对旗下PDF文档处理控件
Aspose.Pdf for .NET发布了新的11.6版本,在新的版本中对PDF转换为PDF/A, PDF转换为TIFF/JPEG 和 HTML转换为PDF进行了增强,并且对产品提供的API在处理各种复杂情况进行了提高,对以往版本中出现的BUG进行了修复,具体可以参考下面的介绍:
1.在PDF转换为TIFF文档时可以使用Bradley算法了,具体如下:
string outputImageFile = @"c:\resultant.tif";
string outputBinImageFile = @"c:\37116-bin.tif";
//open document
//create Resolution object
Resolution resolution = new Resolution(300);
//create TiffSettings object
TiffSettings tiffSettings = new TiffSettings();
tiffSettings.Compression = CompressionType.LZW;
tiffSettings.Depth =
Aspose.Pdf.Devices.ColorDepth.Format1bpp;
//create TIFF device
TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);
//convert a particular page and save the image to stream
tiffDevice.Process(pdfDocument, outputImageFile);
using (FileStream inStream = new FileStream(outputImageFile, FileMode.Open))
{
using (FileStream outStream = new FileStream(outputBinImageFile, FileMode.Create))
{
tiffDevice.BinarizeBradley(inStream, outStream, 0.1);
}
}
2.PageNumberStamp类新增了自定义页码样式功能,PageNumberStamp类主要用于把PDF文档页码以邮戳的形式添加到PDF文档里,下面的代码讲述了如何使用自定义页码样式
// load existing PDF file
Document doc = new Document("source.pdf");
// instantiate PageNumberStamp object
PageNumberStamp page_Stamp = new PageNumberStamp();
// set numbering style for page number stamp
// select numberingstyle value from enumeration
page_Stamp.NumberingStyle = NumberingStyle.NumeralsRomanUppercase;
// itterate through PDF pages
foreach (Page page in doc.Pages)
{
// put page numbering style stamp
page_Stamp.Put(page);
}
// save updated PDF document
doc.Save("resultnat.pdf");
3.完整的更新内容可以参考下面的链接,开发人员可以从
控件中国网下载最新的试用版进行测试:
http://www.aspose.com/docs/display/pdfnet/
Aspose.Pdf+for+.NET+11.6.0+Release+Notes