Obtén Metadatos XMP de un Archivo PDF Existente - facades
Contents
[
Hide
]
Para obtener metadatos XMP de un archivo PDF, necesitas crear un objeto PdfXmpMetadata y vincular el archivo PDF usando el método bindPdf(..). Puedes pasar propiedades de metadatos XMP específicas al objeto PdfXmpMetadata para obtener sus valores.
El siguiente fragmento de código te muestra cómo obtener metadatos XMP de un archivo PDF.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-pdf/Aspose.Pdf-for-Java | |
// create PdfXmpMetadata object | |
PdfXmpMetadata xmpMetaData = new PdfXmpMetadata(); | |
// bind PDF file to the object | |
xmpMetaData.bindPdf("TextAnnotation_output.pdf"); | |
// get XMP Meta Data properties | |
System.out.println("Creation Date : " + xmpMetaData.getByDefaultMetadataProperties(DefaultMetadataProperties.CreateDate)); | |
System.out.println("MetaData Date : " + xmpMetaData.getByDefaultMetadataProperties(DefaultMetadataProperties.MetadataDate)); | |
System.out.println("Creator Tool : " + xmpMetaData.getByDefaultMetadataProperties(DefaultMetadataProperties.CreatorTool)); | |
System.out.println("User Property Name : " + xmpMetaData.getXmpMetadata("customNamespace:UserPropertyName")); |