Package org.apache.fop.pdf

Examples of org.apache.fop.pdf.PDFName


    public void populateXObjectDictionary(PDFDictionary dict) {
        ColorModel cm = getEffectiveColorModel();
        if (cm instanceof IndexColorModel) {
            IndexColorModel icm = (IndexColorModel)cm;
            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


        addMapping("wrapper",                   "Span");
        addMapping("marker",                    "Private");
    }

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

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

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

        }
    }

    public static PDFName mapFormattingObject(Node fo, PDFObject parent,
            EventBroadcaster eventBroadcaster) {
        PDFName type = null;
        Node role = fo.getAttributes().getNamedItemNS(null, "role");
        if (role == null) {
            type = mapFormattingObject(fo.getLocalName(), parent);
        } else {
            String customType = role.getNodeValue();
            type = (PDFName) STANDARD_STRUCTURE_TYPES.get(customType);
            if (type == null) {
                String foName = fo.getLocalName();
                type = mapFormattingObject(foName, parent);
                PDFEventProducer.Provider.get(eventBroadcaster).nonStandardStructureType(fo,
                        foName, customType, type.toString().substring(1));
            }
        }
        assert type != null;
        return type;
    }
View Full Code Here

        public PDFName getStructureType(PDFObject parent) {
            PDFStructElem grandParent = (PDFStructElem)
                ((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 = (PDFName) STANDARD_STRUCTURE_TYPES.get("TH");
            } else {
                type = (PDFName) STANDARD_STRUCTURE_TYPES.get("TD");
            }
View Full Code Here

    public void populateXObjectDictionary(PDFDictionary dict) {
        ColorModel cm = getEffectiveColorModel();
        if (cm instanceof IndexColorModel) {
            IndexColorModel icm = (IndexColorModel)cm;
            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

        rootStructureElement.addKid(structElem);
        ancestors.add(structElem);
    }

    private PDFStructElem createStructureElement(String name, PDFObject parent, String role) {
        PDFName structureType = FOToPDFRoleMap.mapFormattingObject(name, role, parent, eventBroadcaster);
        return pdfFactory.getDocument().makeStructureElement(structureType, parent);
    }
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

        addMapping("wrapper",                   "Span");
        addMapping("marker",                    "Private");
    }

    private static void addStructureType(String structureType) {
        STANDARD_STRUCTURE_TYPES.put(structureType, new PDFName(structureType));
    }
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.