Package org.apache.fop.pdf

Examples of org.apache.fop.pdf.PDFOutputIntent


     * Adds an OutputIntent to the PDF as mandated by PDF/A-1 when uncalibrated color spaces
     * are used (which is true if we use DeviceRGB to represent sRGB colors).
     * @throws IOException in case of an I/O problem
     */
    private void addPDFA1OutputIntent() throws IOException {
        PDFOutputIntent outputIntent = pdfDoc.getFactory().makeOutputIntent();
        outputIntent.setSubtype(PDFOutputIntent.GTS_PDFA1);
        PDFICCStream icc = pdfDoc.getFactory().makePDFICCStream();
        ICC_Profile profile;
        InputStream in = PDFDocument.class.getResourceAsStream("sRGB Color Space Profile.icm");
        if (in != null) {
            try {
                profile = ICC_Profile.getInstance(in);
            } finally {
                IOUtils.closeQuietly(in);
            }
        } else {
            //Fallback: Use the sRGB profile from the JRE (about 140KB)
            profile = ICC_Profile.getInstance(ColorSpace.CS_sRGB);
        }
        String desc = getICCProfileDescription(profile);
       
        icc.setColorSpace(profile, null);
        outputIntent.setDestOutputProfile(icc);
        outputIntent.setOutputConditionIdentifier(desc);
        outputIntent.setInfo(outputIntent.getOutputConditionIdentifier());
        pdfDoc.getRoot().addOutputIntent(outputIntent);
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.pdf.PDFOutputIntent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.