Package com.itextpdf.xmp.options

Examples of com.itextpdf.xmp.options.SerializeOptions


                    PdfProperties.setProducer(xmpMeta, producer);
                    XmpBasicProperties.setModDate(xmpMeta, date.getW3CDate());
                    XmpBasicProperties.setMetaDataDate(xmpMeta, date.getW3CDate());

                    SerializeOptions serializeOptions = new SerializeOptions();
                    serializeOptions.setPadding(2000);
                    XMPMetaFactory.serialize(xmpMeta, baos, serializeOptions);
                } else {
                    XmpWriter xmpw = createXmpWriter(baos, newInfo);
                    xmpw.close();
                }
View Full Code Here


   */
  public static void serialize(XMPMetaImpl xmp, OutputStream out,
    SerializeOptions options)
    throws XMPException
  {
    options = options != null ? options : new SerializeOptions();   
   
    // sort the internal data model on demand
    if (options.getSort())
    {
      xmp.sort();
View Full Code Here

   */
  public static String serializeToString(XMPMetaImpl xmp, SerializeOptions options)
    throws XMPException
  {
    // forces the encoding to be UTF-16 to get the correct string length
    options = options != null ? options : new SerializeOptions();   
    options.setEncodeUTF16BE(true);

    ByteArrayOutputStream out = new ByteArrayOutputStream(2048);
    serialize(xmp, out, options);

View Full Code Here

                XMPUtils.removeProperties(xmpMeta, XMPConst.NS_XMP, XmpBasicProperties.CREATEDATE, true, true);
                XMPUtils.removeProperties(xmpMeta, XMPConst.NS_XMP, XmpBasicProperties.MODIFYDATE, true, true);
                XMPUtils.removeProperties(xmpMeta, XMPConst.NS_XMP, XmpBasicProperties.METADATADATE, true, true);
                XMPUtils.removeProperties(xmpMeta, XMPConst.NS_PDF, PdfProperties.PRODUCER, true, true);

                cmpBytes = XMPMetaFactory.serializeToBuffer(xmpMeta, new SerializeOptions(SerializeOptions.SORT));

                xmpMeta = XMPMetaFactory.parseFromBuffer(outBytes);
                XMPUtils.removeProperties(xmpMeta, XMPConst.NS_XMP, XmpBasicProperties.CREATEDATE, true, true);
                XMPUtils.removeProperties(xmpMeta, XMPConst.NS_XMP, XmpBasicProperties.MODIFYDATE, true, true);
                XMPUtils.removeProperties(xmpMeta, XMPConst.NS_XMP, XmpBasicProperties.METADATADATE, true, true);
                XMPUtils.removeProperties(xmpMeta, XMPConst.NS_PDF, PdfProperties.PRODUCER, true, true);

                outBytes = XMPMetaFactory.serializeToBuffer(xmpMeta, new SerializeOptions(SerializeOptions.SORT));
            }

            if (!compareXmls(cmpBytes, outBytes)) {
                return "The XMP packages different!";
            }
View Full Code Here

   * @param extraSpace
   * @throws IOException
   */
  public XmpWriter(OutputStream os, String utfEncoding, int extraSpace) throws IOException {
        outputStream = os;
        serializeOptions = new SerializeOptions();
        if (UTF16BE.equals(utfEncoding) || UTF16.equals(utfEncoding))
            serializeOptions.setEncodeUTF16BE(true);
        else if (UTF16LE.equals(utfEncoding))
            serializeOptions.setEncodeUTF16LE(true);
        serializeOptions.setPadding(extraSpace);
View Full Code Here

TOP

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

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.