move setPageMargin to the begining of document initialization