Obter Metadados XMP de um Arquivo PDF Existente - facades
Contents
[
Hide
]
Para obter metadados XMP de um arquivo PDF, você precisa criar um objeto PdfXmpMetadata e vincular o arquivo PDF usando o método bindPdf(..). Você pode passar propriedades de metadados XMP específicas para o objeto PdfXmpMetadata para obter seus valores.
O seguinte trecho de código mostra como obter metadados XMP de um arquivo 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")); |