finished the change of the document generator.

	if the document is bigger than one page, the signature cannot be on the last page, this commit fixes this error.
fixed document margin top