Package com.itextpdf.xmp.options

Examples of com.itextpdf.xmp.options.PropertyOptions


     * @param author
     */
    static public void setAuthor(XMPMeta xmpMeta, String[] author) throws XMPException {
        XMPUtils.removeProperties(xmpMeta, XMPConst.NS_DC, CREATOR, true, true);
        for (int i = 0; i < author.length; i++) {
            xmpMeta.appendArrayItem(XMPConst.NS_DC, CREATOR, new PropertyOptions(PropertyOptions.ARRAY_ORDERED), author[i], null);
        }
    }
View Full Code Here


     *
     * @param xmpMeta
     * @param publisher
     */
    static public void addPublisher(XMPMeta xmpMeta, String publisher) throws XMPException {
        xmpMeta.appendArrayItem(XMPConst.NS_DC, PUBLISHER, new PropertyOptions(PropertyOptions.ARRAY_ORDERED), publisher, null);
    }
View Full Code Here

     * @param publisher
     */
    static public void setPublisher(XMPMeta xmpMeta, String[] publisher) throws XMPException {
        XMPUtils.removeProperties(xmpMeta, XMPConst.NS_DC, PUBLISHER, true, true);
        for (int i = 0; i < publisher.length; i++) {
            xmpMeta.appendArrayItem(XMPConst.NS_DC, PUBLISHER, new PropertyOptions(PropertyOptions.ARRAY_ORDERED), publisher[i], null);
        }
    }
View Full Code Here

     *                  the empty string.
     * @param value     the value of the array item.
     * @throws XMPException Wraps all errors and exceptions that may occur.
     */
    public void appendArrayItem(String schemaNS, String arrayName, String value) throws XMPException {
        xmpMeta.appendArrayItem(schemaNS, arrayName, new PropertyOptions(PropertyOptions.ARRAY), value, null);
    }
View Full Code Here

     *                  the empty string.
     * @param value     the value of the array item.
     * @throws XMPException Wraps all errors and exceptions that may occur.
     */
    public void appendOrderedArrayItem(String schemaNS, String arrayName, String value) throws XMPException {
        xmpMeta.appendArrayItem(schemaNS, arrayName, new PropertyOptions(PropertyOptions.ARRAY_ORDERED), value, null);
    }
View Full Code Here

     *                  the empty string.
     * @param value     the value of the array item.
     * @throws XMPException Wraps all errors and exceptions that may occur.
     */
    public void appendAlternateArrayItem(String schemaNS, String arrayName, String value) throws XMPException {
        xmpMeta.appendArrayItem(schemaNS, arrayName, new PropertyOptions(PropertyOptions.ARRAY_ALTERNATE), value, null);
    }
View Full Code Here

        if (key instanceof String)
            key = new PdfName((String) key);
        if (PdfName.TITLE.equals(key)) {
            xmpMeta.setLocalizedText(XMPConst.NS_DC, DublinCoreProperties.TITLE, XMPConst.X_DEFAULT, XMPConst.X_DEFAULT, value);
        } else if (PdfName.AUTHOR.equals(key)) {
            xmpMeta.appendArrayItem(XMPConst.NS_DC, DublinCoreProperties.CREATOR, new PropertyOptions(PropertyOptions.ARRAY_ORDERED), value, null);
        } else if (PdfName.SUBJECT.equals(key)) {
            xmpMeta.setLocalizedText(XMPConst.NS_DC, DublinCoreProperties.DESCRIPTION, XMPConst.X_DEFAULT, XMPConst.X_DEFAULT, value);
        } else if (PdfName.KEYWORDS.equals(key)) {
            for (String v : value.split(",|;"))
                if (v.trim().length() > 0)
                    xmpMeta.appendArrayItem(XMPConst.NS_DC, DublinCoreProperties.SUBJECT, new PropertyOptions(PropertyOptions.ARRAY), v.trim(), null);
            xmpMeta.setProperty(XMPConst.NS_PDF, PdfProperties.KEYWORDS, value);
        } else if (PdfName.PRODUCER.equals(key)) {
            xmpMeta.setProperty(XMPConst.NS_PDF, PdfProperties.PRODUCER, value);
        } else if (PdfName.CREATOR.equals(key)) {
            xmpMeta.setProperty(XMPConst.NS_XMP, XmpBasicProperties.CREATORTOOL, value);
View Full Code Here

    ParameterAsserts.assertSchemaNS(schemaNS);
    ParameterAsserts.assertArrayName(arrayName);

    if (arrayOptions == null)
    {
      arrayOptions = new PropertyOptions();
    }
    if (!arrayOptions.isOnlyArrayOptions())
    {
      throw new XMPException("Only array form flags allowed for arrayOptions",
          XMPError.BADOPTIONS);
View Full Code Here

    specificLang = Utils.normalizeLangValue(specificLang);

    XMPPath arrayPath = XMPPathParser.expandXPath(schemaNS, altTextName);

    // Find the array node and set the options if it was just created.
    XMPNode arrayNode = XMPNodeUtils.findNode(tree, arrayPath, true, new PropertyOptions(
        PropertyOptions.ARRAY | PropertyOptions.ARRAY_ORDERED
            | PropertyOptions.ARRAY_ALTERNATE | PropertyOptions.ARRAY_ALT_TEXT));

    if (arrayNode == null)
    {
View Full Code Here

    public void createXmpMetadata() {
        try {
            xmpWriter = createXmpWriter(null, pdf.getInfo());
            if (isTagged()) {
                try {
                    xmpWriter.getXmpMeta().setPropertyInteger(XMPConst.NS_PDFUA_ID, PdfProperties.PART, 1, new PropertyOptions(PropertyOptions.SEPARATE_NODE));
                } catch (XMPException e) {
                    throw new ExceptionConverter(e);
                }
            }
            xmpMetadata = null;
View Full Code Here

TOP

Related Classes of com.itextpdf.xmp.options.PropertyOptions

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.