public ExtendedDocument(OutputStream out, IPdfAWriterConfiguration configuration) throws DocumentException { if ( configuration != null ) { this.writer = ExtendedPdfAWriter.getInstance( this, out, configuration ); configuration.configure( (PdfAWriter) writer ); } else { this.writer = ExtendedPdfAWriter.getInstance( this, out ); } headerFooter = createExtendedHeaderFooter(); initAttributes(); }