Use binary mode for temporary files when using pdf_from_string