Support of PDF/A_2U standard and Improved PDF Optimization in Aspose.Pdf for .NET 16.12.0

Share on FacebookTweet about this on TwitterShare on LinkedIn

 

We are pleased to announce the release of Aspose.Pdf for .NET 16.12.0. A new feature, the support of PDF/A_2U standard along with number of enhancements and improvements are included in this release. Some of the enhancements are improved PDF Optimization and support of XML stream conversion to PDF. It also contains number of fixes of bugs reported in previous versions by our valued customers, that makes it more stable release as compared to previous releases. Some of them are PDF to PPTX conversion issues, PDF to PDFA standard conversion issues along with many other bug fixes. Please check the detailed release notes of Aspose.Pdf for .NET 16.12.0, in order to get an idea about the new features/enhancements and fixed bugs in this release of Aspose.Pdf for .NET.

Furthermore, If you are planning to upgrade the API from any previous version, we strongly recommend you to check the Public API Changes section of current release and other intermediate releases from release notes pages, to know what has been changed since your current revision of the API.

The following sections describe some details regarding these newly added features/enhancements.

Support of PDF/A_2U standard

We have introduced new PDFA standard, PDF/A_2U, in Aspose.Pdf for .NET 16.12.0. We have included a new value PDF_A_2U in PdfFormt enum. Please check following code snippet for new feature.


string inFile = "Input.pdf";
string outFile = "Output.pdf";
string outLog = "log.xml";
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(inFile);
PdfFormatConversionOptions opts = new PdfFormatConversionOptions(outLog, PdfFormat.PDF_A_2U, ConvertErrorAction.Delete);
doc.Convert(opts);
doc.Save(outFile);

PDF optimization feature improved

In this release we have improved the PDF optimization feature with introduction of some new properties in OptimizationOption class. Mainly resizing of the embedded images reduces the PDF file size, ResizeImages and MaxResolution properties for the purpose along with RemovePrivateInfo:


Aspose.Pdf.Document document = new Aspose.Pdf.Document(inFile);
document.OptimizeResources(new Aspose.Pdf.Document.OptimizationOptions()
{
LinkDuplcateStreams = true,
RemoveUnusedObjects = true,
RemoveUnusedStreams = true,
CompressImages = true,
ResizeImages = true,
RemovePrivateInfo = true,
ImageQuality = 50,
MaxResoultion = 75
});

....

Support of XML stream conversion

Some of customers have requirement to render XML stream to PDF instead file. So we have introduced a new constructor of BindXml() that support Stream parameter.


string inXml = "sample.xml";
string inXslt = "sample.xslt";
string outFile = "output.pdf";
Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
doc.BindXml(new FileStream(inXml, FileMode.OpenOrCreate), new FileStream(inXslt, FileMode.OpenOrCreate));
doc.Save(outFile);

Support of Html text conversion in XML to PDF conversion

Recently, we have introduced a new XML schema of Aspose.Pdf(new generator). XSD includes in MSI installer. We have introduced HTML text support in new XML schema with this release. Here is sample XML and code for the conversion:

Sample XML


<?xml version='1.0' encoding='utf-8'?>
<Document xmlns="Aspose.Pdf">
<Page>
<HtmlFragment>some text<Hyperlink URL="www.google.com" /></HtmlFragment>
</Page>
</Document>

Sample Code

string inXml = "sample.xml";
string outFile = "output.pdf";
Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
doc.BindXml(inXml);
doc.Save(outFile);

Aspose.Pdf for .NET Resources

The following resources will help you work with Aspose.Pdf for .NET: