abhinavc/documentMaster — comment on commit 9b26e17f2825f6b382e20c0bde5e2cc5550002b4
File:  line 0
By adamarla:

Good catch for the other one but not sure about this reasoning here mate.

The docBegin, preamble and docEnd tags are being written to the answer key outside of the page iteration logic. Whereas for the preview pages, these are being written inside the loop. Not sure why your are seeing multiple docBegins in the same file, I am not.