WORDS-424 - add error support to PdfBuilder, some refactoring