تصدير الإشارات المرجعية إلى XML من ملف PDF موجود (واجهات)
Contents
[
Hide
]
تسمح لك طريقة exportBookmarksToXml بتصدير الإشارات المرجعية من ملف PDF إلى ملف XML.
لتصدير الإشارات المرجعية:
- قم بإنشاء كائن PdfBookmarkEditor واربط ملف PDF باستخدام طريقة bindPdf.
- استدعاء طريقة exportBookmarksToXml.
يُظهر لك مقتطف الشيفرة التالي كيفية تصدير الإشارات المرجعية إلى ملف XML.
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 PdfBookmarkEditor object | |
PdfBookmarkEditor bookmarkEditor = new PdfBookmarkEditor(); | |
// Open PDF file | |
bookmarkEditor.bindPdf("Input.pdf"); | |
// Export bookmarks | |
bookmarkEditor.exportBookmarksToXML("bookmarks.xml"); | |
bookmarkEditor.dispose(); |
From Aspose.PDF for Java 9.0.0، تقوم فئة PdfBookmarkEditor بتنفيذ أساليب exportBookmarksToXML وimportBookmarksWithXML مع متغيرات Stream. نتيجة لذلك، يمكن حفظ العلامات المرجعية المستخرجة في كائن تدفق.
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 PdfBookmarkEditor object | |
PdfBookmarkEditor bookmarkeditor = new PdfBookmarkEditor(); | |
// Open PDF file | |
bookmarkeditor.bindPdf("Input.pdf"); | |
OutputStream os = new FileOutputStream("bookmark.xml"); | |
bookmarkeditor.exportBookmarksToXML(os); | |
bookmarkeditor.dispose(); |