mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-03-04 02:20:19 +01:00
feat(form-fill): add CSV and XLSX extraction for form fields, improve file ID handling (#5776)
This commit is contained in:
@@ -258,7 +258,9 @@ public class JobExecutorService {
|
||||
// GlobalExceptionHandler (either directly or wrapped)
|
||||
Throwable cause = e.getCause();
|
||||
if (e instanceof IllegalArgumentException
|
||||
|| cause instanceof stirling.software.common.util.ExceptionUtils.BaseAppException
|
||||
|| cause
|
||||
instanceof
|
||||
stirling.software.common.util.ExceptionUtils.BaseAppException
|
||||
|| cause
|
||||
instanceof
|
||||
stirling.software.common.util.ExceptionUtils
|
||||
|
||||
@@ -132,7 +132,7 @@ public class FormUtils {
|
||||
continue;
|
||||
}
|
||||
|
||||
String currentValue = safeValue(terminalField);
|
||||
String currentValue = safeFieldValue(terminalField);
|
||||
boolean required = field.isRequired();
|
||||
int pageIndex = resolveFirstWidgetPageIndex(document, terminalField, annotationPageMap);
|
||||
List<String> options = resolveOptions(terminalField);
|
||||
@@ -203,7 +203,7 @@ public class FormUtils {
|
||||
continue;
|
||||
}
|
||||
|
||||
String currentValue = safeValue(terminalField);
|
||||
String currentValue = safeFieldValue(terminalField);
|
||||
boolean required = field.isRequired();
|
||||
boolean readOnly = field.isReadOnly();
|
||||
List<String> options = resolveOptions(terminalField);
|
||||
@@ -1234,7 +1234,11 @@ public class FormUtils {
|
||||
return states;
|
||||
}
|
||||
|
||||
private String safeValue(PDTerminalField field) {
|
||||
public String safeValue(String value) {
|
||||
return value != null ? value : "";
|
||||
}
|
||||
|
||||
private String safeFieldValue(PDTerminalField field) {
|
||||
try {
|
||||
// PDChoice.getValueAsString() returns a raw COS string representation
|
||||
// that doesn't reliably reflect the selected value. Use getValue()
|
||||
|
||||
Reference in New Issue
Block a user