Instead of applying the pattern yourself to every page using ElementBuilder, you could also do the following.
1. Create a temporary page.
2. Use ElementBuilder API to create tile pattern (as described in previous message).
3. Use Stamper class to stamp your temp page to target pages (as either underlay or overlay).