Introduction
Converting existing PDF documents
to PDF/A can be tricky sometimes because for storing the document in PDF/A
format you have to significantly restructure the source document. It involves
fonts embedding, colorspaces normalization and other techniques needed to
produce PDF file conforming to the desired PDF/A standard version (there are
PDF/A-1a, PDF/A-1b and a few more, where PDF/A-1a is the strictest version).
All these changes can’t be performed
manually, and if you need to enable your apps handle PDF to PDF/A conversion
you can use the Apitron PDF Kit
for .NET component. This cross-platform library available for Windows,
Windows Phone, Windows Store, Silverlight, Android and iOS (via Xamarin), and
Mono provides you with an easy and convenient way for creating PDF and PDF/A
documents.
The code
Here is the code for converting the PDF document to its
PDF/A version:
using (Stream inputStream = File.Open("document.pdf", FileMode.Open),
outputStream = File.Create("document_pdfa.pdf"))
{
using (FixedDocument pdfDocument = new FixedDocument(inputStream, PdfStandard.PDFA))
{
// ...
you can add or edit the contents of the PDF file here
pdfDocument.Save(outputStream);
}
}
The
resulting document is shown below:
Pic. 1 Converted PDF/A document
|
Conclusion
Other topics related to PDF
conversion and manipulation are covered in our blog and in the free book
available for download from our website. The latest version of the Apitron PDF
Kit is available by the following link.
Contact us if you have any questions regarding our components and we’ll be
happy to help you.
Downloadable version of this article can be found by the following link [PDF].
Downloadable version of this article can be found by the following link [PDF].
No comments:
Post a Comment