Adds PDF drawing to label template and code refactoring