Archiving reports digitally with PDF/A
Document archiving is an essential requirement for organizations which are dependent on historical or sensitive data. In this electronic era, we are creating heaps of digital data and archiving them from time to time. It becomes important that these electronic documents are stored in a way that remains pertinent when referenced in future.
PDF/A is a specialized standard for digital preservation that defines guidelines for archiving PDF documents for future retrieval. This standard ensures long term sustenance of PDF documents with respect to their visual appearance and preserves display on all devices irrespective of the tool or the platform.
ActiveReports has always had support for exporting reports to PDF, and with the latest ActiveReports 7 Service Pack 1 release it has taken a step further and added support for PDF/A as well. This simply implies that reports created using ActiveReports can be exported to PDF/A documents and therefore can be archived for long term preservation. ActiveReports7 includes support for all the PDF Compliance levels and their versions listed below.
- PDF/A - 1
- PDF/A - 1A
- PDF/A - 1B
- PDF/A - 2
- PDF/A - 2A
- PDF/A - 2B
- PDF/A - 2U
- PDF/A - 3
- PDF/A - 3A
- PDF/A - 3B
- PDF/A - 3U
A report created using ActiveReports can be exported to any of these standards by just setting the Version property for the PDF Export Filter or PDF Rendering Extension to required PDF/A category.
Here are a few steps to create a PDF/A documents using ActiveReports7:
- The first step to create a PDF/A document in ActiveReports 7 begins with creating a report using ActiveReports. You can create either Code Based Section Reports (.cs/vb) or XML Based Section Reports (.rpx) or Page Based Reports (.rdlx).
- Write code to export the report to the required PDF/A standard.
Following code snippets illustrate how to export an ActiveReports 7 report to PDF/A for different report types Export of Section Report to PDF/A format:
var rpt = new SectionReport1(); //SectionReport Object
rpt.Run();
var pdfexport = new GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport(); //PDF ExportFilter
pdfexport.Version = GrapeCity.ActiveReports.Export.Pdf.Section.PdfVersion.PDFA1a; //PDF-A Compliance version
pdfexport.Export(rpt.Document, @"C:\\SectionReport_PDF-A.PDF");
Export of Page Report to PDF/A format:
var pageReport = new GrapeCity.ActiveReports.PageReport();
pageReport.Load(new System.IO.FileInfo("PageReport1.rdlx"));
var pageDoc = new GrapeCity.ActiveReports.Document.PageDocument(pageReport);
var settings = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();
settings.Version = GrapeCity.ActiveReports.Export.Pdf.Page.PdfVersion.PDFA2a;
string exportFile = "myReport.pdf";
var myFile = new System.IO.FileInfo(exportFile);
var renderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
var provider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(myFile.Directory,"myReport");
pageDoc.Render(renderingExtension, provider, settings);