Decision 1 ...
\n" + "Attachment A#1 ...
\n" + "Attachment B#1 ...
\n" + "\n" + "\n"; private static final String html2 = "\n" + "\n" + "" + "\n" + "Decision 2 ...
\n" + "Attachment B#2...
\n" + "\n" + "\n"; @Test public void testOutline() throws Exception { writePDF("target/test-outline1.pdf", new ITextOutputDevice(26.666666F), html2, html1); writePDF("target/test-outline2.pdf", new ITextOutputDevice(26.666666F), html1, html2); } private void writePDF(String name, ITextOutputDevice outputDevice, String html1, String html2) throws Exception { FileOutputStream stream = new FileOutputStream(name); try { ITextRenderer renderer = new ITextRenderer(outputDevice.getDotsPerPoint(), 20, outputDevice); renderer.setDocumentFromString(html1); renderer.layout(); renderer.createPDF(stream, false); renderer.setDocumentFromString(html2); renderer.layout(); renderer.writeNextDocument(); renderer.finishPDF(); } finally { stream.close(); } } }