Moved utility functions to PDFUtils