For example, here some java/PDFBox-based implementation of how to flatten simple forms: https://gist.github.com/jribble/beddf7620536939f88db
(IIRC there are more form elements than those 2-3 handled here(?)).
Note that QPDF does not have something like the PDAcroForm class (and its friends) used there to easily access the form data. So any QPDF/C++ based form flattener has to implement that, too.
For example, here some java/PDFBox-based implementation of how to flatten simple forms: /gist.github. com/jribble/ beddf7620536939 f88db
https:/
(IIRC there are more form elements than those 2-3 handled here(?)).
Note that QPDF does not have something like the PDAcroForm class (and its friends) used there to easily access the form data. So any QPDF/C++ based form flattener has to implement that, too.