11

Hi I am a bit stuck here, trying to use jspdf for printing html to pdf. So first of all I tried with some examples and it worked. But when I try to implement the same in My Django Website, there is an issue.

1. Its working with Internet explorer, I am able to download the Pdf

2. But same is not working with Chrome (why).

By following some post :get_URL().createObjectURL error I was able understand that:

issue is with the AJax Calls where i am changing the URL to some other value.

Also looked in to :window.URL.createObjectURL(blob); is undefined in my application

But it doesn't says any clear solution to the problem. How to make the things work.

So far I have checked : None of the JS files inclusion is missed , as its working fine with internet explorer. But in Explorer my ajax Calls doesn't works

Here is the error I am getting enter image description here

Any help would be appreciated :)

Community
  • 1
  • 1
coder3521
  • 2,608
  • 1
  • 28
  • 50
  • As the answers you have linked say, you have almost certainly got some code that says var URL = something. Have you checked all your code and any 3rd party code you use for URL (case sensitively)? – Peter Brittain Jul 03 '15 at 09:26
  • Ya I do , I am using some Ajax calls their i have set some URL, But the question how to solve it , having still used the URL , and absolutely no idea why it works in Internet explorer .but not in Chrome – coder3521 Jul 03 '15 at 09:37
  • 1
    And have you tried renaming them as per the advice in the articles you already found? – Peter Brittain Jul 04 '15 at 17:44
  • have you tried using window.webkitURL.createObjectURL() ? Also are you serving your page via some local server or just opening plain html? – Ajay Gupta Jul 08 '15 at 15:20
  • Still this question is unanswered . Hope if someone could answer it – coder3521 Dec 29 '15 at 11:41
  • Isn't one of your plugins blocking a cetain javascript file? I had that some times – Jostcrow Feb 09 '17 at 13:29

1 Answers1

1

Not sure if I can help much, but what I understand is that the error you are seeing is caused by createObjectURL being undefined, so the first thing I would check is why this happens.

Have you tried writing something like window.ULR.createObjectURL(new Blob) in the console? Try writing this on your application page, and if it stil happens, you have something that changes the URL object.

The next step would be to temporarily remove one javascript file at a time to find out which one makes the trouble.

Note: Yes, I know the question is old, but it still deserves a solution.

16patsle
  • 513
  • 7
  • 12