pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1599044 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDMetadata.java
Date Sun, 01 Jun 2014 21:10:43 GMT
Author: msahyoun
Date: Sun Jun  1 21:10:43 2014
New Revision: 1599044

URL: http://svn.apache.org/r1599044
Log:
PDFBOX-2107 Make PDFBox XMP library agnostic

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDMetadata.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDMetadata.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDMetadata.java?rev=1599044&r1=1599043&r2=1599044&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDMetadata.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDMetadata.java
Sun Jun  1 21:10:43 2014
@@ -76,11 +76,14 @@ public class PDMetadata extends PDStream
     /**
      * Extract the XMP metadata and create and build an in memory object.
      * To persist changes back to the PDF you must call importXMPMetadata.
+     * 
+     * @deprecated will return an InputStream in the future.
      *
      * @return A parsed XMP object.
      *
      * @throws IOException If there is an error parsing the XMP data.
      */
+    @Deprecated
     public XMPMetadata exportXMPMetadata() throws IOException
     {
         return XMPMetadata.load( createInputStream() );
@@ -92,8 +95,25 @@ public class PDMetadata extends PDStream
      * @param xmp The XMP data.
      *
      * @throws IOException If there is an error generating the XML document.
+     */
+    public void importXMPMetadata( byte[] xmp )
+        throws IOException
+    {
+    	OutputStream os = createOutputStream;
+        os.write(xmp)
+        os.close();
+    }
+    
+    
+    /**
+     * Import an XMP stream into the PDF document.
+     *
+     * @param xmp The XMP data.
+     *
+     * @throws IOException If there is an error generating the XML document.
      * @throws TransformerException If there is an error generating the XML document.
      */
+    @Deprecated
     public void importXMPMetadata( XMPMetadata xmp )
         throws IOException, TransformerException
     {



Mime
View raw message