Class RTFOffsetInserter


  • public class RTFOffsetInserter
    extends Object
    This class offers the possibility to insert a start offset into rtf contents meaning that the rendered content starts beneath this inital offset. This class has been created for converting rtf mail bodies. The initial offset is needed such that the mail body starts right beneath the attachment listing.
    • Field Detail

      • NEEDLE_STRING

        public static final String NEEDLE_STRING
        The needle stream in the rtf document. The rtf offset marker will be inserted in front of this marker.
        See Also:
        Constant Field Values
      • NEEDLE

        public static final int[] NEEDLE
        The int representation of the needle string.
    • Constructor Detail

      • RTFOffsetInserter

        public RTFOffsetInserter()
    • Method Detail

      • insertOffsetIntoRTFStream

        public static com.levigo.jadice.document.io.SeekableInputStream insertOffsetIntoRTFStream​(com.levigo.jadice.document.io.SeekableInputStream sis,
                                                                                                  String encoding,
                                                                                                  double pageViewHeight,
                                                                                                  double pageViewHeightOffset)
                                                                                           throws IOException
        Inserts the rtf body offset such that the body appears below the email metadata.
        Parameters:
        sis - the input stream.
        encoding - the encoding that has been determined for the input stream.
        pageViewHeight - this parameter is ignored.
        pageViewHeightOffset - the offset.
        Returns:
        the rtf body string with the proper top offset such that it fits to the previously generated mail metadata.
        Throws:
        IOException - If an I/O error occurs
      • getBOMBytes

        public static byte[] getBOMBytes​(org.apache.commons.io.input.BOMInputStream bomInputStream)
                                  throws IOException
        Throws:
        IOException