استخدام WorkbookMetadata
Contents
[
Hide
]
يسمح لك Aspose.Cells بتحميل إصدار خفيف الوزن من المصنف في الذاكرة لتحرير معلومات بيانات التعريف الخاصة به. الرجاء استخدامcom.aspose.cells.WorkbookMetadata فئة لتحميل المصنف.
استخدام WorkbookMetadata
يستخدم نموذج التعليمات البرمجية التاليالمصنف فئة لتحرير خصائص المستند المخصصة لمصنف. بمجرد فتح المصنف باستخدامدفتر العمل ستتمكن من قراءة خصائص المستند.
إليك نموذج التعليمات البرمجية باستخدام الامتدادالمصنفصف دراسي.
This file contains 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-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(UsingWorkbookMetadata.class); | |
// Open Workbook metadata | |
MetadataOptions options = new MetadataOptions(MetadataType.DOCUMENT_PROPERTIES); | |
WorkbookMetadata meta = new WorkbookMetadata(dataDir + "Sample1.xlsx", options); | |
// Set some properties | |
meta.getCustomDocumentProperties().add("test", "test"); | |
// Save the metadata info | |
meta.save(dataDir + "Sample1.out.xlsx"); | |
// Open the workbook | |
Workbook w = new Workbook(dataDir + "Sample1.out.xlsx"); | |
// Read document property | |
System.out.println(w.getCustomDocumentProperties().get("test")); |