更新时间:2022-06-24 08:29:25
试试这个。它对我有用。 setLocalGoto()
和 setLocalDestination()
将起到魔力。
Try this. It worked for me. setLocalGoto()
and setLocalDestination()
will do the magic.
Chunk chunk = new Chunk("Contact information");
chunk.setLocalGoto("contact");
document.add(new Paragraph(chunk));
document.newPage();
chunk chunk1 = new Chunk("Contact information");
chunk1.setLocalDestination("contact");
Chapter chapter = new Chapter(new Paragraph(chunk1),1);
chapter.setNumberDepth(0);
document.add(chapter);