Пример #1
0
 /**
  * Writes the initialisation part of the RtfList
  *
  * @return A byte array containing the initialisation part
  */
 protected byte[] writeListBeginning() {
   ByteArrayOutputStream result = new ByteArrayOutputStream();
   try {
     result.write(RtfParagraph.PARAGRAPH_DEFAULTS);
     if (this.inTable) {
       result.write(RtfParagraph.IN_TABLE);
     }
     switch (this.alignment) {
       case Element.ALIGN_LEFT:
         result.write(RtfParagraphStyle.ALIGN_LEFT);
         break;
       case Element.ALIGN_RIGHT:
         result.write(RtfParagraphStyle.ALIGN_RIGHT);
         break;
       case Element.ALIGN_CENTER:
         result.write(RtfParagraphStyle.ALIGN_CENTER);
         break;
       case Element.ALIGN_JUSTIFIED:
       case Element.ALIGN_JUSTIFIED_ALL:
         result.write(RtfParagraphStyle.ALIGN_JUSTIFY);
         break;
     }
     // .result.write(writeIndentations());
     writeIndentations(result);
     result.write(RtfFont.FONT_SIZE);
     result.write(intToByteArray(fontNumber.getFontSize() * 2));
     if (this.symbolIndent > 0) {
       result.write("\\tx".getBytes());
       result.write(intToByteArray(this.leftIndent));
     }
   } catch (IOException ioe) {
     ioe.printStackTrace();
   }
   return result.toByteArray();
 }