【Foxit PDF SDK】福昕GSDK如何将PDF文档中嵌入的附件文件导出并保存为一个单独的文件?

请参考以下代码段:

// Get information of attachments.

Attachments attachments = new Attachments(doc, empty_nametree);

int count = attachments.getCount();

for (int i = 0; i < count; i++) {

String key = attachments.getKey(i);

FileSpec file_spec = attachments.getEmbeddedFile(key);

if (!file_spec.isEmpty()) {

String name = file_spec.getFileName();

if (file_spec.isEmbedded()) {

String export_file_path = output_path + name;

file_spec.exportToFile(export_file_path);

}

}

}