Dirk Ulrich wrote:
But this way, the numbering seems not to be continued in the scetions/subsections.
Of course not. If you don't set the number depth yourself, the default number depth (1) is used. I told you before: I don't appreciate it when people don't read the docs.
Attached is a misformed pdf document.
I don't understand what's misformed about it. Adapt the Dirk.java example so that it demonstrates what you think is wrong. I already added the setNumberDepth method to the example in attachment. br, Bruno
dirk.pdf
Description: application/octetstream
package test;
import java.io.FileOutputStream;
import java.io.IOException;
import com.lowagie.text.Chapter;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Section;
import com.lowagie.text.pdf.PdfWriter;
public class Dirk {
public static void main(String[] args) {
Document document = new Document();
try {
PdfWriter.getInstance(document, new
FileOutputStream("dirk.pdf"));
document.open();
Chapter chapter1 = new Chapter("Chapter 1", 1);
chapter1.setNumberDepth(0);
Section section1 = chapter1.addSection(20, "Section");
section1.add(new Paragraph("blah blah blah"));
section1.setNumberDepth(2);
Paragraph title1 = new Paragraph("subsection 1");
title1.setIndentationLeft(20);
Section subsection1 = section1.addSection(20, title1);
subsection1.add(new Paragraph("blah blah blah"));
Paragraph title2 = new Paragraph("subsection 2");
title2.setIndentationLeft(20);
Section subsection2 = section1.addSection(20, title2);
subsection2.add(new Paragraph("blah blah blah"));
Section section2 = chapter1.addSection(20, "Section");
section2.add(new Paragraph("blah blah blah"));
section2.setNumberDepth(2);
document.add(chapter1);
Chapter chapter2 = new Chapter("Chapter 2", 2);
chapter2.setTriggerNewPage(false);
document.add(chapter2);
} catch (IOException e) {
e.printStackTrace();
} catch (DocumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
document.close();
}
}
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
