* @throws IOException
*/
public void writeHeadersFooters(ByteArrayOutputStream os) throws IOException {
if (this.footer instanceof RtfHeaderFooters) {
RtfHeaderFooters rtfHf = (RtfHeaderFooters) this.footer;
HeaderFooter hf = rtfHf.get(RtfHeaderFooters.ALL_PAGES);
if (hf != null) {
writeHeaderFooter(hf, footerBegin, os);
}
hf = rtfHf.get(RtfHeaderFooters.LEFT_PAGES);
if (hf != null) {
writeHeaderFooter(hf, footerlBegin, os);
}
hf = rtfHf.get(RtfHeaderFooters.RIGHT_PAGES);
if (hf != null) {
writeHeaderFooter(hf, footerrBegin, os);
}
hf = rtfHf.get(RtfHeaderFooters.FIRST_PAGE);
if (hf != null) {
writeHeaderFooter(hf, footerfBegin, os);
}
} else {
writeHeaderFooter(this.footer, footerBegin, os);
}
if (this.header instanceof RtfHeaderFooters) {
RtfHeaderFooters rtfHf = (RtfHeaderFooters) this.header;
HeaderFooter hf = rtfHf.get(RtfHeaderFooters.ALL_PAGES);
if (hf != null) {
writeHeaderFooter(hf, headerBegin, os);
}
hf = rtfHf.get(RtfHeaderFooters.LEFT_PAGES);
if (hf != null) {