Package org.apache.fop.pdf

Examples of org.apache.fop.pdf.PDFName


    private static void addStructureType(String structureType) {
        STANDARD_STRUCTURE_TYPES.put(structureType, new PDFName(structureType));
    }

    private static void addMapping(String fo, String structureType) {
        PDFName type = STANDARD_STRUCTURE_TYPES.get(structureType);
        assert type != null;
        addMapping(fo, new SimpleMapper(type));
    }
View Full Code Here


     * @param eventBroadcaster the event broadcaster
     * @return the structure type or null if no match could be found
     */
    public static PDFName mapFormattingObject(String fo, String role,
            PDFObject parent, EventBroadcaster eventBroadcaster) {
        PDFName type = null;
        if (role == null) {
            type = getDefaultMappingFor(fo, parent);
        } else {
            type = STANDARD_STRUCTURE_TYPES.get(role);
            if (type == null) {
                type = getDefaultMappingFor(fo, parent);
                PDFEventProducer.Provider.get(eventBroadcaster).nonStandardStructureType(fo,
                        fo, role, type.toString().substring(1));
            }
        }
        assert type != null;
        return type;
    }
View Full Code Here

    private static class TableCellMapper implements Mapper {

        public PDFName getStructureType(PDFObject parent) {
            PDFStructElem grandParent = ((PDFStructElem) parent).getParentStructElem();
            //TODO What to do with cells from table-footer? Currently they are mapped on TD.
            PDFName type;
            if (THEAD.equals(grandParent.getStructureType())) {
               type = STANDARD_STRUCTURE_TYPES.get("TH");
            } else {
                type = STANDARD_STRUCTURE_TYPES.get("TD");
            }
View Full Code Here

                            + " but the profile description does not match what was expected: "
                            + desc);
                }
                //It's the default sRGB profile which we mapped to DefaultRGB in PDFRenderer
                cs = (PDFICCBasedColorSpace)doc.getResources().getColorSpace(
                        new PDFName("DefaultRGB"));
            }
            if (cs == null) {
                // sRGB hasn't been set up for the PDF document
                // so install but don't set to DefaultRGB
                cs = PDFICCBasedColorSpace.setupsRGBColorSpace(doc);
View Full Code Here

     * @param dict the dictionary to fill in
     * @param icm the image color model
     */
    protected void populateXObjectDictionaryForIndexColorModel(PDFDictionary dict, IndexColorModel icm) {
        PDFArray indexed = new PDFArray(dict);
        indexed.add(new PDFName("Indexed"));
        if (icm.getColorSpace().getType() != ColorSpace.TYPE_RGB) {
            log.warn("Indexed color space is not using RGB as base color space."
                    + " The image may not be handled correctly." + " Base color space: "
                    + icm.getColorSpace() + " Image: " + image.getInfo());
        }
        indexed.add(new PDFName(toPDFColorSpace(icm.getColorSpace()).getName()));
        int c = icm.getMapSize();
        int hival = c - 1;
        if (hival > MAX_HIVAL) {
            throw new UnsupportedOperationException("hival must not go beyond " + MAX_HIVAL);
        }
View Full Code Here

TOP

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

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.