PDF 파일에서 XML로 데이터 내보내기 (Facades)
Contents
[
Hide
]
Form 클래스는 exportXml 메서드를 사용하여 PDF 파일에서 XML 파일로 데이터를 내보낼 수 있게 해줍니다. 데이터를 XML로 내보내기 위해서는 Form 클래스의 객체를 생성하고, bindPDF 메서드를 사용하여 원본 PDF 양식을 열고, OutputStream 객체를 사용하여 exportXml 메서드를 호출해야 합니다. 마지막으로 OutputStream 객체를 닫고 Form 객체를 폐기할 수 있습니다. 다음 코드 스니펫은 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 | |
// 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(); |