If you're in this method, then you will be rendering a PDF. Just force the output format if the platform is OS X. Don't check the filename extension.