Hello,
Please tell what PDFBox version you're using and create a MINIMAL
reproducer. Your current code does not flatten at all (because flatten
is commented out), and uses an external class do do something that isn't
related to flattening. Your reproducer should just load the file, select
some fields, and flatten and produce the problem.
Tilman
Am 26.05.2021 um 07:53 schrieb Ranjeet Kuruvilla:
I know how Itext works and PDFBox does not work the same. In Itext the
result is that only the right fields are flattened. It seems there is a bug.
In PdfBox every field is flattened, even though I delivered a list of
fields, that were meant to be flattened.
It seems the PDF is destroyed by flattening.
I have attached the code.
On 25.05.21 19:27, Tilman Hausherr wrote:
Here's a PDF flattened by itext
https://github.com/itext/i7js-examples/blob/develop/cmpfiles/sandbox/acroforms/cmp_checkbox_flatten.pdf
and they do something similar to what we do, i.e. remove the fields
and converting it to form XObjects.
Tilman
Am 25.05.2021 um 19:03 schrieb [email protected]:
Am Dienstag, dem 25.05.2021 um 18:33 +0200 schrieb Ranjeet Kuruvilla:
Hallo.
It is clear, that flattening does have a bug. Compare flattening of
PDFBox with IText and you realize, that PDFBox destroys all fields,
once
I call
acroform.flatten(fields, true) or acroform.flatten(fields, false)
the purpose of flatten is that the flattened fields are removed and
become part of the regular page content.
If you'd like to keep the field but would like it to be protected you
have to set the field to read only. Keep in mind that one could use a
lib and remove the flag and change the content afterwards.
Now, if there is really a bug I need to have a clear description how to
reproduce it together with sample content. If you're able to provide
that I'm happy to take a look.
BR
Maruan
.
How can I request someone to fix flattening and make it work like in
IText. That is that the right fields are flattened while all the other
fields remain untouched!
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]