HTML to PDF Generation without Print Format

Hello Everyone,

I am trying to convert html to pdf using the get_pdf whitelisted function but it’s showing error XHR is not defined, can anybody help me on this.

Or Let me know if any alternate solution is there without print format.