The output of pdfwrite currently does not preserve any optional content contained in an input PDF file. We need to add the possibility to do so.
See bug 690633 for a simple OC handler that just skips invisible content. Sample files with invisible layers include: comparefiles/BFAX35P5.pdf and sample files attached to the bugs 689289, 689716, 689924, 690633.
One more file with OC is comparefiles/Bug689290.pdf The file is identical to the sample file of the bug 689289.
*** Bug 697063 has been marked as a duplicate of this bug. ***