Aspose.Pdf for Java发布了新的17.2版本

作者:控件中国网   出处:控件中国网   2017-03-03 09:43:14   阅读:0

Aspose.Pdf for Java是一款针对PDF文件操作和转换类的Java控件,可以通过代码灵活地对PDF文件进行全方位的处理,该产品无论是从功能上还是产品易用性上都受到了全球广大开发人员的好评,在新的17.2版本中该产品也进行了许多加强和修复了以往存在的BUG:
 
在新的版本中该产品支持转换PDF为PDFA_3U
Document doc = new Document("inFile.pdf"); 
PdfFormatConversionOptions opts = new PdfFormatConversionOptions("outLog.txt", PdfFormat.PDF_A_3U, ConvertErrorAction.Delete);
doc.convert(opts);
doc.save("outFile.pdf");
在新的版本中支持从PDF文件中提取标记的内容为图片
//Open document
Document document = new Document("sample.pdf");
//instantiate PdfExtractor
PdfExtractor pdfExtractor = new PdfExtractor();
//Extract Chart objects as image in a folder
pdfExtractor.extractMarkedContentAsImages(document.getPages().get_Item(1), "C:/Temp/Charts_page_1");
document.close();
在新的版本中支持转换PDF文件为像素化的TIFF图片
//Open document
com.Aspose.Pdf.Document pdfDocument = new com.Aspose.Pdf.Document("Input.pdf");
//Create stream object to save the output image
java.io.OutputStream imageStream = new java.io.FileOutputStream("Image.tiff");
//Create Resolution object
com.Aspose.Pdf.devices.Resolution resolution = new com.Aspose.Pdf.devices.Resolution(300);
//instantiate TiffSettings object
com.Aspose.Pdf.devices.TiffSettings tiffSettings  = new com.Aspose.Pdf.devices.TiffSettings();
//set the compression of resultant TIFF image
tiffSettings.setCompression(com.Aspose.Pdf.devices.CompressionType.CCITT4);
//set the color depth for resultant image
tiffSettings.setDepth(com.Aspose.Pdf.devices.ColorDepth.Format4bpp);
//skip blank pages while rendering PDF to TIFF
tiffSettings.setSkipBlankPages(true);
//set image brightness
//tiffSettings.setBrightness(.5f);
//set IndexedConversion Type, default value is simple
tiffSettings.setIndexedConversionType(IndexedConversionType.Pixelated);
//Create TiffDevice object with particular resolution
com.Aspose.Pdf.devices.TiffDevice   tiffDevice = new com.Aspose.Pdf.devices.TiffDevice(2480, 3508,resolution,tiffSettings);
//Convert a particular page (Page 1) and save the image to stream
tiffDevice.process(pdfDocument,1,1,imageStream);
//Close the stream
imageStream.close();
在新的版本中还对PDF转换为PDFA, HTML转换为PDF, PCL转换为PDF以及PDF转换为PPTX进行了增强
Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat