Example usage for com.lowagie.text.pdf PdfWriter VERSION_1_4

List of usage examples for com.lowagie.text.pdf PdfWriter VERSION_1_4

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfWriter VERSION_1_4.

Prototype

char VERSION_1_4

To view the source code for com.lowagie.text.pdf PdfWriter VERSION_1_4.

Click Source Link

Document

possible PDF version (header)

Usage

From source file:cn.js.nt.yao.sudokupdf.PDFRender.java

License:Apache License

private void openDocument() {
    try {// w ww. ja va 2s.c om
        if (doc != null) {
            return;
        }

        doc = new Document();
        doc.setPageSize(getLayout().getPageSize());
        pdfFile = File.createTempFile("sudoku", ".pdf");
        getPdfFile().deleteOnExit();
        writer = PdfWriter.getInstance(doc, new BufferedOutputStream(new FileOutputStream(getPdfFile())));
        getWriter().setPdfVersion(PdfWriter.VERSION_1_4);
        getWriter().setViewerPreferences(PdfWriter.PageModeUseNone);
        getDoc().open();
    } catch (DocumentException ex) {
        Logger.getLogger(PDFRender.class.getName()).log(Level.SEVERE, null, ex);
        throw new RuntimeException(ex);
    } catch (IOException ex) {
        Logger.getLogger(PDFRender.class.getName()).log(Level.SEVERE, null, ex);
        throw new RuntimeException(ex);
    }
}

From source file:lucee.runtime.tag.PDF.java

License:Open Source License

/**
 * @param version the version to set/*w  w w .  j av  a2 s. c  om*/
 * @throws ApplicationException 
 */
public void setVersion(double version) throws ApplicationException {
    if (1.1 == version)
        this.version = '1';
    else if (1.2 == version)
        this.version = PdfWriter.VERSION_1_2;
    else if (1.3 == version)
        this.version = PdfWriter.VERSION_1_3;
    else if (1.4 == version)
        this.version = PdfWriter.VERSION_1_4;
    else if (1.5 == version)
        this.version = PdfWriter.VERSION_1_5;
    else if (1.6 == version)
        this.version = PdfWriter.VERSION_1_6;

    else
        throw new ApplicationException("invalid version definition [" + Caster.toString(version)
                + "], valid version definitions are " + "[1.1, 1.2, 1.3, 1.4, 1.5, 1.6]");
}

From source file:org.lucee.extension.pdf.tag.PDF.java

License:Open Source License

/**
 * @param version/*from   ww w .  ja va2s . c om*/
 *            the version to set
 * @throws PageException
 */
public void setVersion(double version) throws PageException {
    if (1.1 == version)
        this.version = '1';
    else if (1.2 == version)
        this.version = PdfWriter.VERSION_1_2;
    else if (1.3 == version)
        this.version = PdfWriter.VERSION_1_3;
    else if (1.4 == version)
        this.version = PdfWriter.VERSION_1_4;
    else if (1.5 == version)
        this.version = PdfWriter.VERSION_1_5;
    else if (1.6 == version)
        this.version = PdfWriter.VERSION_1_6;

    else
        throw engine.getExceptionUtil().createApplicationException(
                "invalid version definition [" + engine.getCastUtil().toString(version)
                        + "], valid version definitions are " + "[1.1, 1.2, 1.3, 1.4, 1.5, 1.6]");
}