PDF/A
PDF/A (Archiving) is a subset of the standard PDF specification that specifically targets PDF documents that need to be preserved long-term. The goal of the PDF/A specification was to create a specification that defined a PDF document to be self-contained and device-independent. The result of a document adhering to the PDF/A specification will remain readable, renderable, and accessible for an indefinite amount of time in the future, even as technologies like media and data formats could change over time.
DynamicPDF can produce and preserve PDF documents with the following conformance levels.
- PDF/A-1a
- PDF/A-1b
- PDF/A-2a
- PDF/A-2b
- PDF/A-2u
- PDF/A-3a
- PDF/A-3b
- PDF/A-3u
Conformance Level B (PDF/A-1b) is the minimum requirement for PDF/A compliance and guarantees that the text will be displayed appropriately. Conformance Level A (PDF/A-1a) builds off Level B compliance, warrants that the text will display correctly, and uses PDF tagging to preserve the document's logical structure.
Rules to Follow for PDF/A-1a & PDF/A-1b
Follow the following rules to make a Document PDF/A compliant.
- Embed all fonts (core fonts cannot be used).
- Only device-independent colors.
- Include XMP MetaData in all documents.
- Do not encrypt documents.
- Do not use form fields using OpenType font with postscript outlines.
- Do not use buttons, checkboxes, or radio buttons form fields.
- Do not use LZW compression (GIF Images).
- Do not embed any files.
- Never reference external content.
- Images cannot be transparent (Transparency Group or Transparent Images).
- Do not add any multimedia content.
- Do not use JavaScript.
- Tag all PDFs (required only for PDF/A-1a compliance).
Text, combo box, list box, and signature form fields can be used.
All of the above elements must be in place for full PDF/A compatibility. This includes verifying that all images added or merged in PDF pages (if DynamicPDF Merger is used) do not contain any RGB colors. Be careful not to inadvertently use any RGB colors in the document (our product does not automatically check for this). Lastly, verify that all the fonts you used are embedded in the PDF. This means that all fonts used within your PDF document need to be either OpenTypeFont or Type1Font objects. The 14 core fonts are not embedded into the PDF and, therefore, can not be used when creating PDF/A-1b documents.
The DynamicPDF Evaluation Watermark will cause the PDF to not validate as PDF/A. For options on removing the watermark during evaluation, please contact DynamicPDF Support.
PDF/A-1a Example
The following example illustrates the elements needed to specify a document as PDF/A (PDF/A-1a) compatible.
Document document = new Document();
document.Title = "PDF/A1 Document";
document.Subject = "Document's Subject";
document.Tag = new TagOptions();
document.Author = "MyAuthor";
XmpMetadata xmp = new XmpMetadata();
// User has to add PDF/A schema with the conformance level.
PdfASchema pdfaschema = new PdfASchema(PdfAStandard.PDF_A_1a_2005);
xmp.AddSchema(pdfaschema);
DublinCoreSchema dc = xmp.DublinCore;
dc.Title.DefaultText = document.Title;
dc.Description.DefaultText = document.Subject;
dc.Creators.Add(document.Author);
dc.Title.AddLang("en-us", "PDF/A1 Document");
document.XmpMetadata = xmp;
// Needs iccprofile file to be embedded.
IccProfile iccProfile = new IccProfile(@"C:\Temp\IccProfile\sRGB_IEC61966-2-1_noBPC.icc");
OutputIntent outputIntents = new OutputIntent("", "IEC 61966-2.1 Default RGB colour space - sRGB 1 ", "http://www.color.org", "sRGB IEC61966-2.1 1", iccProfile);
outputIntents.Version = OutputIntentVersion.PDF_A;
document.OutputIntents.Add(outputIntents);
string text = "PDF/A (Archiving) specifically targets PDF documents that need to be preserved long term.";
OpenTypeFont openTypeFont = new OpenTypeFont("times.ttf");
Label label = new Label(text, 0, 0, 504, 100, openTypeFont, 18, TextAlign.Center, RgbColor.BlueViolet);
Page page = new Page(PageSize.Letter, PageOrientation.Portrait, 54.0f);
page.Elements.Add(label);
document.Pages.Add(page);
document.Draw(pdfFilePath);
Dim MyDocument As Document = New Document()
MyDocument.Title = "PDF/A1 Document"
MyDocument.Subject = "Document's Subject"
MyDocument.Tag = New TagOptions()
MyDocument.Author = "MyAuthor"
Dim MyXmp As XmpMetadata = New XmpMetadata()
' User has to add PDF/A schema with the conformance level.
Dim MyPdfaSchema As PdfASchema = New PdfASchema(PdfAStandard.PDF_A_1a_2005)
MyXmp.AddSchema(pdfaschema)
Dim MyDc As DublinCoreSchema = MyXmp.DublinCore
MyDc.Title.DefaultText = MyDocument.Title
MyDc.Description.DefaultText = MyDocument.Subject
MyDc.Creators.Add(MyDocument.Author);
MyDc.Title.AddLang("en-us", "PDF/A1 Document")
MyDocument.XmpMetadata = MyXmp
' Needs iccprofile file to be embedded.
Dim MyIccProfile As IccProfile = New IccProfile("C:\Temp\IccProfile\sRGB_IEC61966-2-1_noBPC.icc")
Dim MyOutputIntents As OutputIntent = New OutputIntent("","IEC 61966-2.1 Default RGB colour space - sRGB 1 ","http://www.color.org","sRGB IEC61966-2.1 1",MyIccProfile)
MyOutputIntents.Version = OutputIntentVersion.PDF_A
MyDocument.OutputIntents.Add(MyOutputIntents)
Dim MyText As String = "PDF/A (Archiving) specifically targets PDF documents that need to be preserved long term."
Dim MyOpenTypeFont As OpenTypeFont = New OpenTypeFont("times.ttf")
Dim MyLabel As Label = New Label(MyText,0,0,504,100,MyOpenTypeFont,18,TextAlign.Center,RgbColor.BlueViolet)
Dim MyPage As Page = New Page(PageSize.Letter,PageOrientation.Portrait,54.0f)
MyPage.Elements.Add(MyLabel)
MyDocument.Pages.Add(MyPage)
MyDocument.Draw(pdfFilePath)
PDF/A-3a Example
The following code sample demonstrates how to create PDF/A-3a document with file attachments ( Embedded Files).
Document document = new Document();
document.Title = "PDF/A1 Document";
document.Subject = "Document's Subject";
document.Tag = new TagOptions();
document.Author = "MyAuthor";
XmpMetadata xmp = new XmpMetadata();
// User has to add PDF/A schema with the conformance level.
PdfASchema pdfaschema = new PdfASchema(PdfAStandard.PdfA3a);
xmp.AddSchema(pdfaschema);
DublinCoreSchema dc = xmp.DublinCore;
dc.Title.DefaultText = document.Title;
dc.Description.DefaultText = document.Subject;
dc.Creators.Add(document.Author);
dc.Title.AddLang("en-us", "PDF/A1 Document");
document.XmpMetadata = xmp;
// Needs iccprofile file to be embedded.
IccProfile iccProfile = new IccProfile(@"ProfilePath\sRGB_IEC61966-2-1_noBPC.icc");
OutputIntent outputIntents = new OutputIntent("", "IEC 61966-2.1 Default RGB colour space - sRGB 1 ", "http://www.color.org", "sRGB IEC61966-2.1 1", iccProfile);
outputIntents.Version = OutputIntentVersion.PDF_A;
document.OutputIntents.Add(outputIntents);
EmbeddedFile embeddedFile1 = new EmbeddedFile(@"ExcelFilePath\HelloWorldExcel.xls");
embeddedFile1.Relation = EmbeddedFileRelation.Data;
embeddedFile1.MimeType = "application/excel";
document.EmbeddedFiles.Add(embeddedFile1);
EmbeddedFile embeddedFile2 = new EmbeddedFile(@"XMLFilePath\Simple.xml");
embeddedFile2.Relation = EmbeddedFileRelation.Source;
embeddedFile2.MimeType = "application/xml";
document.EmbeddedFiles.Add(embeddedFile2);
string text = "PDF/A (Archiving) specifically targets PDF documents that need to be preserved long term.";
OpenTypeFont openTypeFont = new OpenTypeFont("times.ttf");
openTypeFont.Subset = false;
Label label = new Label(text, 0, 0, 504, 100, openTypeFont, 18, TextAlign.Center, RgbColor.BlueViolet);
Page page = new Page(PageSize.Letter, PageOrientation.Portrait, 54.0f);
page.Elements.Add(label);
document.Pages.Add(page);
document.Draw(pdfFilePath);
Dim MyDocument As Document = New Document()
MyDocument.Title = "PDF/A1 Document"
MyDocument.Subject = "Document's Subject"
MyDocument.Tag = New TagOptions()
MyDocument.Author = "MyAuthor"
Dim MyXmp As XmpMetadata = New XmpMetadata()
' User has to add PDF/A schema with the conformance level.
Dim MyPdfaSchema As PdfASchema = New PdfASchema(PdfAStandard.PdfA3a)
MyXmp.AddSchema(MyPdfaSchema)
Dim MyDc As DublinCoreSchema = MyXmp.DublinCore
MyDc.Title.DefaultText = MyDocument.Title
MyDc.Description.DefaultText = MyDocument.Subject
MyDc.Creators.Add(MyDocument.Author)
MyDc.Title.AddLang("en-us", "PDF/A1 Document")
MyDocument.XmpMetadata = MyXmp
' Needs iccprofile file to be embedded.
Dim MyIccProfile As IccProfile = New IccProfile(@"ProfilePath\sRGB_IEC61966-2-1_noBPC.icc")
Dim MyOutputIntents As OutputIntent = New OutputIntent("", "IEC 61966-2.1 Default RGB colour space - sRGB 1 ", "http://www.color.org", "sRGB IEC61966-2.1 1", MyIccProfile)
MyOutputIntents.Version = OutputIntentVersion.PDF_A
MyDocument.OutputIntents.Add(MyOutputIntents)
Dim MyEmbeddedFile1 As ceTe.DynamicPDF.EmbeddedFile = New ceTe.DynamicPDF.EmbeddedFile(@"ExcelFilePath\HelloWorldExcel.xls")
MyEmbeddedFile1.Relation = EmbeddedFileRelation.Data
MyEmbeddedFile1.MimeType = "application/excel"
MyDocument.EmbeddedFiles.Add(MyEmbeddedFile1)
Dim MyEmbeddedFile2 As EmbeddedFile = New EmbeddedFile(@"XMLFilePath\Simple.xml")
MyEmbeddedFile2.Relation = EmbeddedFileRelation.Source
MyEmbeddedFile2.MimeType = "application/xml"
MyDocument.EmbeddedFiles.Add(MyEmbeddedFile2)
Dim MyText As String = "PDF/A (Archiving) specifically targets PDF documents that need to be preserved long term."
Dim MyOpenTypeFont As OpenTypeFont = New OpenTypeFont("times.ttf")
MyOpenTypeFont.Subset = False
Dim MyLabel As Label = New Label(MyText, 0, 0, 504, 100, MyOpenTypeFont, 18, TextAlign.Center, RgbColor.BlueViolet)
Dim MyPage As Page = New Page(PageSize.Letter, PageOrientation.Portrait, 54.0F)
MyPage.Elements.Add(MyLabel)
MyDocument.Pages.Add(MyPage)
MyDocument.Draw(pdfFilePath)