On This thread (June 2007) Paulo Soares provides code that shows support for PDF / A. Here's the C # code (it also has a Java sample):
private void PdfATest() { Document doc = new Document(PageSize.A4); PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream("C:\\hello_A1-b_cs.pdf", FileMode.Create)); writer.PDFXConformance = PdfWriter.PDFA1B; doc.Open(); PdfDictionary outi = new PdfDictionary(PdfName.OUTPUTINTENT); outi.Put(PdfName.OUTPUTCONDITIONIDENTIFIER, new PdfString("sRGB IEC61966-2.1")); outi.Put(PdfName.INFO, new PdfString("sRGB IEC61966-2.1")); outi.Put(PdfName.S, PdfName.GTS_PDFA1); // get this file here: http://old.nabble.com/attachment/10971467/0/srgb.profile ICC_Profile icc = ICC_Profile.GetInstance("c:\\srgb.profile"); PdfICCBased ib = new PdfICCBased(icc); ib.Remove(PdfName.ALTERNATE); outi.Put(PdfName.DESTOUTPUTPROFILE, writer.AddToBody(ib).IndirectReference); writer.ExtraCatalog.Put(PdfName.OUTPUTINTENTS, new PdfArray(outi)); BaseFont bf = BaseFont.CreateFont("c:\\windows\\fonts\\arial.ttf", BaseFont.WINANSI, true); Font f = new iTextSharp.text.Font(bf, 12); doc.Add(new Paragraph("hello", f)); writer.CreateXmpMetadata(); doc.Close(); }
The link above contains the download of the ICC_Profile file.
source share