write document length with placeholder