Skip to main content

Creating PDF/A Reports

Version: 7.0

Creating PDFA Reports

PDF/A compliance (a subset of the traditional PDF specification used for archiving PDF documents) can be accomplished using DynamicPDF ReportWriter. 

There are a few things to note when creating a PDF/A document with DynamicPDF ReportWriter:

  1. All considerations outlined in the DynamicPDF Generator's PDF/A Topic must be followed.
  2. In Designer, the Document's Tag property should be set to true (required only for PDF/A-1a compliance).
  3. In Designer, all images must have the AltText property filled in.

Creating a PDF/A Report from a Web Form​

Creating a report PDF that is PDF/A compliant from a Web Form (that inherits from DplxWebForm) is done using the Document's LaidOut Event. This allows you to set up the XMP data and the output intent while still taking advantage of the DplxWebForm association. The following code demonstrates creating a PDF/A compliant PDF from within a web form:

using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.Xmp;
using ceTe.DynamicPDF.ReportWriter;


public partial class ReportWriterExamples_PDFA : DplxWebForm
{
protected void Page_Load(object sender, EventArgs e)
{
DrawPdf(@"C:\temp\NewPdfAReport.pdf");
}
private void Document1_DocumentLaidOut(object sender, DocumentLayoutEventArgs e)
{
XmpMetadata xmp = new XmpMetadata();
PdfASchema pdfASchema = new PdfASchema(PdfAStandard.PDF_A_1a_2005);
xmp.AddSchema(pdfASchema);
DublinCoreSchema dublinCoreSchema = xmp.DublinCore;
dublinCoreSchema.Title.AddLang("en-us", "PDF/A1 Document");

IccProfile iccProfile = new IccProfile(@"C:\Temp\sRGB_IEC61966-2-1_noBPC.icc");
OutputIntent outputIntent = new OutputIntent("", "IEC 61966-2.1 Default RGB colour space - sRGB 1 ", "http://www.color.org", "sRGB IEC61966-2.1 1", iccProfile);
outputIntent.Version = OutputIntentVersion.PDF_A;

e.LayoutWriter.Document.OutputIntents.Add(outputIntent);
e.LayoutWriter.Document.XmpMetadata = xmp;
}
}
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.Xmp
Imports ceTe.DynamicPDF.ReportWriter

Partial Class ReportWriterExamples_PDFA
Inherits DplxWebForm

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
DrawPdf("C:\temp\NewPdfAReport.pdf")
End Sub

Private Sub Document1_DocumentLaidOut(ByVal sender As Object, ByVal e As DocumentLayoutEventArgs)
Dim xmp As New XmpMetadata()
Dim pdfASchema As New PdfASchema(PdfAStandard.PDF_A_1a_2005)
xmp.AddSchema(pdfASchema)
Dim dublinCoreSchema As DublinCoreSchema = xmp.DublinCore
dublinCoreSchema.Title.AddLang("en-us", "PDF/A1 Document")

Dim iccProfile As New IccProfile("C:\Temp\sRGB_IEC61966-2-1_noBPC.icc")
Dim outputIntent As New OutputIntent("", "IEC 61966-2.1 Default RGB colour space - sRGB 1 ", "http://www.color.org", "sRGB IEC61966-2.1 1", iccProfile)
outputIntent.Version = OutputIntentVersion.PDF_A

e.LayoutWriter.Document.OutputIntents.Add(outputIntent)
e.LayoutWriter.Document.XmpMetadata = xmp
End Sub

End Class