Ensure the returned string's encoding matches the options

We use to_pdf and then still do things with the returned string. We were hitting issues where the PDFKit to_pdf string was consistently returning a ASCII-8BIT string. Adding the option to set the encoding has resolved the issue without any side effects.