الحصول على بيانات XMP الوصفية من ملف PDF موجود - الواجهات
Contents
[
Hide
]
من أجل الحصول على بيانات XMP الوصفية من ملف PDF، تحتاج إلى إنشاء كائن PdfXmpMetadata وربط ملف PDF باستخدام طريقة bindPdf(..). يمكنك تمرير خصائص بيانات XMP الوصفية المحددة إلى كائن PdfXmpMetadata للحصول على قيمها.
يوضح لك مقتطف الشفرة التالي كيفية الحصول على بيانات XMP الوصفية من ملف 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")); |