1 50 51 package com.lowagie.text.rtf.text; 52 53 import java.io.ByteArrayOutputStream ; 54 import java.io.IOException ; 55 import java.io.OutputStream ; 56 57 import com.lowagie.text.rtf.RtfElement; 58 import com.lowagie.text.rtf.document.RtfDocument; 59 60 61 68 public class RtfNewPage extends RtfElement { 69 70 73 public static final byte[] NEW_PAGE = "\\page".getBytes(); 74 75 80 public RtfNewPage(RtfDocument doc) { 81 super(doc); 82 } 83 84 90 public byte[] write() { 91 ByteArrayOutputStream result = new ByteArrayOutputStream (); 92 try { 93 writeContent(result); 94 } catch(IOException ioe) { 95 ioe.printStackTrace(); 96 } 97 return result.toByteArray(); 98 } 99 102 public void writeContent(final OutputStream result) throws IOException 103 { 104 result.write(NEW_PAGE); 105 result.write(RtfParagraph.PARAGRAPH_DEFAULTS); 106 } 107 108 } 109 | Popular Tags |