Adjust pdf writing to honor PDF/A rules
PDF/A requires (as can be tested with VeraPDF):
- Second line needs to be a comment line with four characters with byte encoding above 127
- "obj" needs to be followed by a new line
- "endobj" needs to start on a new line