예제 #1
0
  /**
   * Writes the content of this RtfParagraph. First paragraph specific data is written and then the
   * RtfChunks of this RtfParagraph are added.
   */
  public void writeContent(final OutputStream result) throws IOException {
    result.write(PARAGRAPH_DEFAULTS);
    result.write(PLAIN);

    if (inTable) {
      result.write(IN_TABLE);
    }

    if (this.paragraphStyle != null) {
      this.paragraphStyle.writeBegin(result);
    }
    result.write(DocWriter.getISOBytes("\\plain"));

    for (int i = 0; i < chunks.size(); i++) {
      RtfBasicElement rbe = (RtfBasicElement) chunks.get(i);
      rbe.writeContent(result);
    }

    if (this.paragraphStyle != null) {
      this.paragraphStyle.writeEnd(result);
    }

    if (!inTable) {
      result.write(PARAGRAPH);
    }
    this.document.outputDebugLinebreak(result);
  }
  /**
   * Writes the content of this RtfParagraph. First paragraph specific data is written and then the
   * RtfChunks of this RtfParagraph are added.
   */
  public void writeContent(final OutputStream result) throws IOException {
    result.write(PARAGRAPH_DEFAULTS);
    result.write(PLAIN);

    if (inTable) {
      result.write(IN_TABLE);
    }

    if (this.paragraphStyle != null) {
      result.write(this.paragraphStyle.writeBegin());
    }
    result.write("\\plain".getBytes());

    for (int i = 0; i < chunks.size(); i++) {
      RtfBasicElement rbe = (RtfBasicElement) chunks.get(i);
      // .result.write((rbe).write());
      rbe.writeContent(result);
    }

    if (this.paragraphStyle != null) {
      result.write(this.paragraphStyle.writeEnd());
    }

    if (!inTable) {
      result.write(PARAGRAPH);
    }
    if (this.document.getDocumentSettings().isOutputDebugLineBreaks()) {
      result.write('\n');
    }
  }
예제 #3
0
 /** Write the content of this PatchRtfCell */
 public void writeContent(final OutputStream result) throws IOException {
   if (this.content.size() == 0) {
     result.write(RtfParagraph.PARAGRAPH_DEFAULTS);
     if (this.parentRow.getParentTable().getTableFitToPage()) {
       result.write(RtfParagraphStyle.KEEP_TOGETHER_WITH_NEXT);
     }
     result.write(RtfParagraph.IN_TABLE);
   } else {
     for (int i = 0; i < this.content.size(); i++) {
       RtfBasicElement rtfElement = this.content.get(i);
       if (rtfElement instanceof RtfParagraph) {
         ((RtfParagraph) rtfElement)
             .setKeepTogetherWithNext(this.parentRow.getParentTable().getTableFitToPage());
       }
       rtfElement.writeContent(result);
       if (rtfElement instanceof RtfParagraph && i < (this.content.size() - 1)) {
         result.write(RtfParagraph.PARAGRAPH);
       }
     }
   }
   result.write(DocWriter.getISOBytes("\\cell"));
 }
예제 #4
0
  public void writeContent(final OutputStream result) throws IOException {
    if (this.paragraphStyle.getSpacingBefore() > 0) {
      result.write(RtfParagraphStyle.SPACING_BEFORE);
      result.write(intToByteArray(paragraphStyle.getSpacingBefore()));
    }
    if (this.paragraphStyle.getSpacingAfter() > 0) {
      result.write(RtfParagraphStyle.SPACING_AFTER);
      result.write(intToByteArray(this.paragraphStyle.getSpacingAfter()));
    }
    for (RtfBasicElement rtfElement : chunks) {
      if (rtfElement instanceof RtfChunk) {
        ((RtfChunk) rtfElement).setSoftLineBreaks(true);
      } else if (rtfElement instanceof RtfList) {
        result.write(RtfParagraph.PARAGRAPH);
        this.containsInnerList = true;
      }

      rtfElement.writeContent(result);
      if (rtfElement instanceof RtfList) {
        result.write(this.parentList.writeListBeginning());
        result.write("\\tab".getBytes());
      }
    }
  }