PDF/A を PDF に変換
Contents
[
Hide
]
PDF/A ドキュメントを PDF に変換するとは、削除することを意味します PDF/A 元のドキュメントからの制限。クラス ドキュメント RemovePdfaCompliance(..) メソッドを持ち、削除します 入力/ソースファイルからの PDF コンプライアンス情報です。
public void convertPDFAtoPDF() {
String pdfaDocumentFileName = new File(fileStorage, "Conversion/sample-pdfa.pdf").toString();
String pdfDocumentFileName = new File(fileStorage, "Conversion/sample-out.pdf").toString();
try {
// Create Document object
document = new Document(pdfaDocumentFileName);
// Remove PDF/A compliance information
document.removePdfaCompliance();
// Save output in XML format
document.save(pdfDocumentFileName);
} catch (Exception e) {
resultMessage.setText(e.getMessage());
return;
}
resultMessage.setText(R.string.success_message);
}
この情報は、ドキュメントに変更を加えると(例:ページを追加する)削除されます。以下の例では、ページを追加した後、出力ドキュメントのPDF/A準拠が失われます。
public void convertPDFAtoPDFAdvanced() {
String pdfaDocumentFileName = new File(fileStorage, "Conversion/sample-pdfa.pdf").toString();
String pdfDocumentFileName = new File(fileStorage, "Conversion/sample-out.pdf").toString();
// Create Document object
document = new Document(pdfaDocumentFileName);
// Adding a new (empty) page removes PDF/A compliance information.
document.getPages().add();
// Save updated document
document.save(pdfDocumentFileName);
}