support multi-page bg + better handling of special w/h combinations


git-svn-id: https://geuz.org/svn/gmsh/trunk@18549 59c8cabf-10d6-4a28-b43f-3936b85956c4