XFA 양식 작업
Contents
[
Hide
]
XFA 양식은 표준 AcroForms로 변환되어 일반 PDF 양식 API로 처리될 수 있습니다.
동적 XFA 양식을 AcroForm으로 변환
public static void convertDynamicXfaToAcroform(Path inputFile, Path outputFile) {
try (Document document = new Document(inputFile.toString())) {
document.getForm().setType(FormType.Standard);
document.save(outputFile.toString());
}
}
ignoreNeedsRendering을 사용하여 XFA 양식 변환
- 원본 PDF
Document를 여세요. - 문서
Form에 액세스하고 필수ignoreNeedsRendering및FormType속성을 설정하세요. - 업데이트된 PDF
Document를 저장하세요.
public static void convertXfaFormWithIgnoreNeedsRendering(Path inputFile, Path outputFile) {
try (Document document = new Document(inputFile.toString())) {
if (!document.getForm().getNeedsRendering() && document.getForm().hasXfa()) {
document.getForm().setIgnoreNeedsRendering(true);
}
document.getForm().setType(FormType.Standard);
document.save(outputFile.toString());
}
}