/** * Use this method to get an instance of the <CODE>PdfWriter</CODE>. * @param document The <CODE>Document</CODE> that has to be written * @param os The <CODE>Stream</CODE> the writer has to write to. * @param conformanceLevel PDF/A conformance level of a new PDF document * @return a new <CODE>PdfWriter</CODE> * @throws DocumentException on error */ public static PdfAWriter GetInstance(Document document, Stream os, PdfAConformanceLevel conformanceLevel) { PdfDocument pdf = new PdfDocument(); document.AddDocListener(pdf); PdfAWriter writer = new PdfAWriter(pdf, os, conformanceLevel); pdf.AddWriter(writer); return(writer); }