The issue: The PDF fields are calculated and the file is saved, but when you view the file in Gmail in preview mode, the calculations are reverted to their original incorrect values. We want the values in preview mode to be correct, and when the physical file is downloaded, we want the fields to be uneditable (aka flattened).
- People suggested using a property called "GenerateAppearances" and setting it to true before any fields are written in the code. I tried this but it did not work.
- People suggested that FormFlattening and GenerateAppearances only work in older versions of iTextSharp so I uninstalled 5.5.9 and installed 5.4.3 which supposedly worked for others, but it didn't for me.
- People suggested using a function called SetFullCompression which I tried but it wiped the form clean completely.
- One person suggested saving the file without flattening, then duplicating the file (create a copy) then apply flattening to the copy and deleting the original file, which I tried but didn't work.
I tried all of these solutions, together and separately, and nothing worked. Now I am at the point where I am just blindly trying different things in the hope that it changes something, but I am getting nowhere, and have run out of suggestions on forums. I feel that someone who has encountered this problem before would know how to solve it immediately, as it appears to be not the first of its kind, but I myself could spend days more trying things that may be futile.