Added handling for strings as well as lists when adding content to PDF