/** * 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. */ public void importXMPMetadata(XMPMetadata xmp) throws IOException, TransformerException { xmp.save(createOutputStream()); }
/** * Extract the XMP metadata and create and build an in memory object. To persist changes back to * the PDF you must call importXMPMetadata. * * @return A parsed XMP object. * @throws IOException If there is an error parsing the XMP data. */ public XMPMetadata exportXMPMetadata() throws IOException { return XMPMetadata.load(createInputStream()); }