내가 아는 한 PDFBox에는 단일 전용 메서드가 포함되어 있지 않습니다. 반면에 기존의 PDFBox 메소드를 사용하여 구현하는 것이 매우 쉽습니다. 모든
먼저, 작업이 효과적으로 PDFBox를 사용
stamper.makePackage(PdfName.T);
에 해당 할 정의된다.
/**
* This is the most simple way to change a PDF into a
* portable collection. Choose one of the following names:
* <ul>
* <li>PdfName.D (detailed view)
* <li>PdfName.T (tiled view)
* <li>PdfName.H (hidden)
* </ul>
* Pass this name as a parameter and your PDF will be
* a portable collection with all the embedded and
* attached files as entries.
* @param initialView can be PdfName.D, PdfName.T or PdfName.H
*/
public void makePackage(final PdfName initialView)
는 따라서, 우리는 타일 전망을 감상 할 수있는 휴대용 수집하기 위해 (아주 최소한) PDF를 변경해야 iText를에 그 방법으로 설명되어 있습니다. ISO 32000-1의 12.3.5 "컬렉션"(나는 아직 두 번째 부분이없는)이 우리가 가진 보기 항목으로 PDF 카탈로그에 컬렉션 사전을 추가 할 필요가 의미 섹션에 따르면
값 T. 따라서 :
PDDocument pdDocument = PDDocument.load(...);
COSDictionary collectionDictionary = new COSDictionary();
collectionDictionary.setName(COSName.TYPE, "Collection");
collectionDictionary.setName("View", "T");
PDDocumentCatalog catalog = pdDocument.getDocumentCatalog();
catalog.getCOSObject().setItem("Collection", collectionDictionary);
pdDocument.save(...);
출처
2017-10-09 13:03:01
mkl