Examples of PDOptionalContentProperties


Examples of org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties

    public PDOptionalContentGroup appendFormAsLayer(PDPage targetPage,
            PDFormXObject form, AffineTransform transform,
            String layerName) throws IOException
    {
        PDDocumentCatalog catalog = targetDoc.getDocumentCatalog();
        PDOptionalContentProperties ocprops = catalog.getOCProperties();
        if (ocprops == null)
        {
            ocprops = new PDOptionalContentProperties();
            catalog.setOCProperties(ocprops);
        }
        if (ocprops.hasGroup(layerName))
        {
            throw new IllegalArgumentException("Optional group (layer) already exists: " + layerName);
        }

        PDOptionalContentGroup layer = new PDOptionalContentGroup(layerName);
        ocprops.addGroup(layer);

        PDResources resources = targetPage.getResources();
        /*PDPropertyList props = resources.getProperties();
        if (props == null)
        {
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties

     * @return the optional properties dictionary or null if it is not present
     */
    public PDOptionalContentProperties getOCProperties()
    {
        COSDictionary dict = (COSDictionary)root.getDictionaryObject(COSName.OCPROPERTIES);
        return dict == null ? null : new PDOptionalContentProperties(dict);
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties

            PDOptionalContentGroup ocg = (PDOptionalContentGroup)page.getResources()
                    .getProperties(COSName.getPDFName("MC0"));
            assertNotNull(ocg);
            assertEquals("overlay", ocg.getName());

            PDOptionalContentProperties ocgs = catalog.getOCProperties();
            PDOptionalContentGroup overlay = ocgs.getGroup("overlay");
            assertEquals(ocg.getName(), overlay.getName());
        }
        finally
        {
            doc.close();
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties

    public PDOptionalContentGroup appendFormAsLayer(PDPage targetPage,
            PDXObjectForm form, AffineTransform transform,
            String layerName) throws IOException
    {
        PDDocumentCatalog catalog = targetDoc.getDocumentCatalog();
        PDOptionalContentProperties ocprops = catalog.getOCProperties();
        if (ocprops == null)
        {
            ocprops = new PDOptionalContentProperties();
            catalog.setOCProperties(ocprops);
        }
        if (ocprops.hasGroup(layerName))
        {
            throw new IllegalArgumentException("Optional group (layer) already exists: " + layerName);
        }

        PDOptionalContentGroup layer = new PDOptionalContentGroup(layerName);
        ocprops.addGroup(layer);

        PDResources resources = targetPage.findResources();
        PDPropertyList props = resources.getProperties();
        if (props == null)
        {
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties

     * @return the optional properties dictionary or null if it is not present
     * @since PDF 1.5
     */
    public PDOptionalContentProperties getOCProperties()
    {
        PDOptionalContentProperties retval = null;
        COSDictionary dict = (COSDictionary)root.getDictionaryObject(COSName.OCPROPERTIES);
        if (dict != null)
        {
            retval = new PDOptionalContentProperties(dict);
        }

        return retval;
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties

    public PDOptionalContentGroup appendFormAsLayer(PDPage targetPage,
            PDXObjectForm form, AffineTransform transform,
            String layerName) throws IOException
    {
        PDDocumentCatalog catalog = targetDoc.getDocumentCatalog();
        PDOptionalContentProperties ocprops = catalog.getOCProperties();
        if (ocprops == null)
        {
            ocprops = new PDOptionalContentProperties();
            catalog.setOCProperties(ocprops);
        }
        if (ocprops.hasGroup(layerName))
        {
            throw new IllegalArgumentException("Optional group (layer) already exists: " + layerName);
        }

        PDOptionalContentGroup layer = new PDOptionalContentGroup(layerName);
        ocprops.addGroup(layer);

        PDResources resources = targetPage.findResources();
        PDPropertyList props = resources.getProperties();
        if (props == null)
        {
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties

     * @return the optional properties dictionary or null if it is not present
     * @since PDF 1.5
     */
    public PDOptionalContentProperties getOCProperties()
    {
        PDOptionalContentProperties retval = null;
        COSDictionary dict = (COSDictionary)root.getDictionaryObject(COSName.OCPROPERTIES);
        if (dict != null)
        {
            retval = new PDOptionalContentProperties(dict);
        }

        return retval;
    }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties

    public PDOptionalContentGroup appendFormAsLayer(PDPage targetPage,
            PDXObjectForm form, AffineTransform transform,
            String layerName) throws IOException
    {
        PDDocumentCatalog catalog = targetDoc.getDocumentCatalog();
        PDOptionalContentProperties ocprops = catalog.getOCProperties();
        if (ocprops == null)
        {
            ocprops = new PDOptionalContentProperties();
            catalog.setOCProperties(ocprops);
        }
        if (ocprops.hasGroup(layerName))
        {
            throw new IllegalArgumentException("Optional group (layer) already exists: " + layerName);
        }

        PDOptionalContentGroup layer = new PDOptionalContentGroup(layerName);
        ocprops.addGroup(layer);

        PDResources resources = targetPage.findResources();
        PDPropertyList props = resources.getProperties();
        if (props == null)
        {
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties

            assertNotNull(props);
            PDOptionalContentGroup ocg = props.getOptionalContentGroup(COSName.getPDFName("MC0"));
            assertNotNull(ocg);
            assertEquals("overlay", ocg.getName());

            PDOptionalContentProperties ocgs = catalog.getOCProperties();
            PDOptionalContentGroup overlay = ocgs.getGroup("overlay");
            assertEquals(ocg.getName(), overlay.getName());
        }
        finally
        {
            doc.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.