iTextSharp.text.pdf.PdfDocument.AddWriter C# (CSharp) Метод

AddWriter() публичный Метод

public AddWriter ( PdfWriter writer ) : void
writer PdfWriter
Результат void
        public void AddWriter(PdfWriter writer)
        {
            if (this.writer == null) {
                this.writer = writer;
                annotationsImp = new PdfAnnotationsImp(writer);
                return;
            }
            throw new DocumentException(MessageLocalization.GetComposedMessage("you.can.only.add.a.writer.to.a.pdfdocument.once"));
        }

Usage Example

Пример #1
1
 /**
  * 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;
 }
All Usage Examples Of iTextSharp.text.pdf.PdfDocument::AddWriter