Is it possible to get the Buttons html5 pdf export to work with IE 10?

Is it possible to get the Buttons html5 pdf export to work with IE 10?

draysmithdraysmith Posts: 3Questions: 1Answers: 0

I'm using DataTables 1.10.9 and buttons 1.0.3. I have included the required files needed for html5 pdf.

I get the error "Object doesn't support property or method 'createPdf'" when I load the report with IE 10.

Has this functionality been confirmed for IE10? Copy, Excel, and Print all seem to work.

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,075Questions: 1Answers: 10,385 Site admin

    It looks like a bug in makepdf, which is the library that Buttons uses to create the PDF. See this issue.

    Based on the suggestions in that discussion, you could try pulling in the latest version of makepdf and see if that helps. The IE10 fix noted in the issue hasn't been released as of yet (last release was 0.1.18 on 26 April) according to their release notes.

    Allan

  • draysmithdraysmith Posts: 3Questions: 1Answers: 0

    Allan,

    Thank you for the prompt response and the great extension. I really love the functionality.

    I did follow up the thread you listed above. My error message was originally the one listed in the issue log. The "Object doesn't support..." error appeared after installing the supposed fix found here. In short, I'm not sure if pdfmake will ever work for IE 10. The developer doesn't think that the browser can use the required apis for anything other than an image file.

    I'm caught in a bit of a catch 22 for the pdf button. IE 10 will detect as html5 capable, so it tries to use html5 pdf instead of the flash pdf. This forces me to use pdfFlash. This button does not work in Chrome since flash has been disabled by default. I suppose I could do a check for IE and execute a different datatables or buttons initialization, but I would really prefer to avoid that type of solution.

    Is it be possible to make IE use pdfFlash instead of html5 when available?

    Thanks again,
    Donovan

  • allanallan Posts: 63,075Questions: 1Answers: 10,385 Site admin

    Yes - we just need to determine what the check should be. Currently this is used:

    return window.FileReader !== undefined && window.pdfMake;
    

    That I guess isn't enough for IE10. I don't particularly want to add a check for the user agent string if there is a way around it. I'll try to find time to investigate some time (not sure when tho!) if there is another check that can be performed, or ideas are welcome.

    Allan

  • draysmithdraysmith Posts: 3Questions: 1Answers: 0

    Allen,

    I was able to eventually get html5 pdf to work on IE10. I made some changes to pdfmake...
    issue 293

    That lead to the error invalidStateError in pdfmake
    older browser fix

    That lead to the same error in buttons.html5.js. After making a very similar code change to the fix outlined for pdfmake, html5 pdf export works in IE10.

    Thanks again,
    Donovan

  • allanallan Posts: 63,075Questions: 1Answers: 10,385 Site admin
    Answer ✓

    Excellent - I hope these can be released into makepdf soon :-). Thanks for the feedback.

    Allan

  • andrew_safwatandrew_safwat Posts: 3Questions: 1Answers: 1
    edited October 2015 Answer ✓

    @draysmith can you send me your final makepdf.js and buttons.html5.js files please?

  • CT General AssemblyCT General Assembly Posts: 17Questions: 2Answers: 1

    Can I get in on the makepdf.js with the changes and the buttons.html5.js as well? I've had to take drastic measures and tell users they cannot create the PDF in IE and would rather not do that.

This discussion has been closed.