support file-like objects, ability to return pdf as string