コード例 #1
0
 /**
 * Adds a <CODE>PdfWriter</CODE> to the <CODE>PdfDocument</CODE>.
 *
 * @param writer the <CODE>PdfWriter</CODE> that writes everything
 *                     what is added to this document to an outputstream.
 * @throws DocumentException on error
 */
 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"));
 }
コード例 #2
0
ファイル: PdfDocument.cs プロジェクト: bmictech/iTextSharp
 /**
 * Adds a <CODE>PdfWriter</CODE> to the <CODE>PdfDocument</CODE>.
 *
 * @param writer the <CODE>PdfWriter</CODE> that writes everything
 *                     what is added to this document to an outputstream.
 * @throws DocumentException on error
 */
 internal void AddWriter(PdfWriter writer)
 {
     if (this.writer == null) {
         this.writer = writer;
         annotationsImp = new PdfAnnotationsImp(writer);
         return;
     }
     throw new DocumentException("You can only add a writer to a PdfDocument once.");
 }