PDFファイルからXMLへのデータエクスポート(ファサード)
Contents
[
Hide
]
Form クラスを使用すると、exportXmlメソッドを使用してPDFファイルからXMLファイルにデータをエクスポートできます。データをXMLにエクスポートするには、まず Form クラスのオブジェクトを作成し、bindPDFメソッドでソースPDFフォームを開き、OutputStreamオブジェクトを使用してexportXmlメソッドを呼び出します。最後に、OutputStreamオブジェクトを閉じてFormオブジェクトを破棄できます。以下のコードスニペットは、データをXMLファイルにエクスポートする方法を示しています。
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-pdf/Aspose.Pdf-for-Java | |
// open document | |
Form form = new Form(); | |
form.bindPdf("student.pdf"); | |
// create XML file. | |
OutputStream xmlOutputStream = new FileOutputStream("student.xml"); | |
// export data | |
form.exportXml(xmlOutputStream); | |
// close file stream | |
xmlOutputStream.close(); | |
// dispose the form object | |
form.dispose(); |