Hey!
I think the current implementation of pdfboxing.form/set-fields saves the document incorrectly, it looks like it does this each time a field is set instead of setting all the fields and then saving at the end. I was writing to a byte array output stream instead of a file
From my testing, this produces two issues:
- the output file is really large (original file: 207KB, save for each field: 5+ MB, save at the end: 240KB)
- the output file can be opened in Chrome but it shows as corrupted when using macOS Preview and iOS Preview
Not entirely sure why it works this but this is the fix:
Reference:
Tested with:
- pdfboxing:
0.1.14
- macOS:
26.2
- iOS:
26.2
- Safari:
26.2
- Chrome:
143.0.7499.170
Hey!
I think the current implementation of
pdfboxing.form/set-fieldssaves the document incorrectly, it looks like it does this each time a field is set instead of setting all the fields and then saving at the end. I was writing to a byte array output stream instead of a fileFrom my testing, this produces two issues:
Not entirely sure why it works this but this is the fix:
Reference:
Tested with:
0.1.1426.226.226.2143.0.7499.170