Escape html special characters from the $fields array to prevent html injection in the generated pdfs.