2014-03-25 4 views
2

iText 및 XMLWorker를 사용하여 PDF를 생성 중입니다. 문제는 페이지 번호가있는 PDF의 목차를 생성해야한다는 것입니다. 나는 mt 섹션 표제를 목록에 넣고 있습니다. 이 목록으로 페이지 번호없이 목차를 생성 할 수 있습니다. 그러나 우리의 요구 사항은 페이지가 필요 없다는 것입니다. 아래 섹션 세부 정보가 포함 된 내 목록입니다.XMLWorker를 사용하여 목차 생성

List<String> sectionList=new ArrayList<String>(); 
sectionList.add("Section1"); 
sectionList.add("Section2"); 
sectionList.add("Section3"); 
sectionList.add("Section4"); 
sectionList.add("Section5");` 

내 CLOB 객체는 우리가 TOC에 어떤 페이지를 필요로하므로

String pdfString="<h1>Section1</h1><p>Some content for section1</p>" + 
      "<h1>Section2</h1><p>Some content for section2</p>" + 
      "<h1>Section3</h1><p>Some content for section3</p>" + 
      "<h1>Section4</h1><p>Some content for section4</p>" + 
      "<h1>Section5</h1><p>Some content for section5</p>"; 

섹션의 내용이 1 개 이상의 페이지가 될 것입니다. 이것을 달성하기위한 와트가 있습니까? 참고 이것은 많은 섹션과 하위 섹션이있는 샘플입니다.

답변