Example usage for com.lowagie.text.pdf PdfStamper makePackage

List of usage examples for com.lowagie.text.pdf PdfStamper makePackage

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfStamper makePackage.

Prototype

public void makePackage(PdfCollection collection) 

Source Link

Document

Adds or replaces the Collection Dictionary in the Catalog.

Usage

From source file:de.jdufner.sudoku.generator.service.PdfGeneratorService.java

License:Open Source License

public void packPdf(String filePathName, String packageFileBaseName, String frontpageFileBaseName,
        String questsFileBaseName, String resultsFileBaseName, String htmlFileName)
        throws FileNotFoundException, DocumentException, IOException {
    PdfStamper pdfStamper = new PdfStamper(new PdfReader(filePathName + frontpageFileBaseName),
            new FileOutputStream(filePathName + packageFileBaseName));
    pdfStamper.addFileAttachment("Quests", null, filePathName + questsFileBaseName, questsFileBaseName);
    pdfStamper.addFileAttachment("Results", null, filePathName + resultsFileBaseName, resultsFileBaseName);
    pdfStamper.addFileAttachment("HTML", null, filePathName + htmlFileName, htmlFileName);
    pdfStamper.makePackage(PdfName.T);
    pdfStamper.close();//from  ww  w  .ja va 2s .c o m
}