I have a PDF with multiple pages that has multiple types of existing form elements that I am programmatically filling out. I can do this successfully and save the output. I have added a file (before.png) as an attachment. I am also flattening each page of the PDF file with ( [page flatAnnots]; ) and then saving the output, so that the form elements can not be modified on a computer afterwards. I have also added this file (after.png) as an attachment. The problem I'm seeing is that the PDF file is missing the checkbox elements from anything after page 2 on the flattened file.
Is flattening the PDF file and losing form elements a bug?
Is there anything else I can do to flatten the file without losing form elements?
Is there anything else I can do to prevent form elements being modified without flattening the page?