-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uiGrid ~rc.20 Export to PDF in IE #2921
Comments
What version of internet explorer? What about it doesn't work - are there console errors for example? I don't have IE, but my usual approach would be to put a breakpoint in the pdfExport method, and step over each line to see which one is failing. My guess is that the open of the separate window is the thing that's failing, but that's native to pdfMake, so maybe it'll end up as a bug report for them? |
We are using IE 11.No errors in the console, It opens the second window but it doesn't render any data to the page. Thank you for your quick response |
Hmm. Without IE it's hard for me to debug, but it sounds like it's calling the pdfMake method, and then the pdf isn't turning up? |
pdfmake doesn't support IE (right now): bpampuch/pdfmake#219 (comment) |
@c0bra Did pdfmake ever support IE? I thought it did! Anyway, is there a way to ask ui-grid to give me the PDF data rather than make a new page? That way for IE I could create an "echo" service for IE, where I send the data to the server and then launch a new page that opens that data. That's not optimal, but the pdfMake guys are saying that's the only way to "support" IE. Plus, I have people asking to be able to automatically email the PDF, and I'd need access to the data for that, too. |
It looks to me like we could just call download (or give an option for download instead of open). Perhaps use the code from csv download that detects IE, and then call download instead of open. Because download looks like it causes problems on iOS devices, so we can't change to that globally. |
I've pushed code that checks for IE and then calls download instead of open. I have no ability to test it, so it'd be great if someone could try it out. |
Fix(exporter): fix #2921 download rather than open pdf in IE
@PaulL1 Confirmed, it works for me in IE11. Good job! Note: the PDF export is still broken in IE, though. |
Oh, what does 'the PDF export is still broken in IE' mean then? I had thought the thing that was broken was that it didn't open the separate tab, and my impression from the pdfMake repository was that it was the open method that was broken, and that download worked fine. Is there something else I need to fix? (it's a bit of a pain not having IE to test with!!) |
As of Internet Explorer 11, the User Agent String has changed
} |
@keerthimysa : any chance of a pull request that adds that code? I don't have IE to test on, and that code looks partial/indicative only - since it isn't setting version numbers anywhere, and I think we need to both know that it's IE and also know which IE version. I think the current isIE function was intended to return 0 if not IE, and otherwise return the version number. |
Sorry, I don't have any pull request that adds the code. |
I would prefer that the function continues to return a version number, but I don't know the format that it returns currently. Could you check what it currently returns for the version number - I think it was formatted like '11.0' or something. Could you then check what value is stored in ua, and whether there's a version number in there? Ideally we'd have a method that returns |
isIE function needs to be changed to below code to work for both csv and pdf. isIE: function () { match value |
What about edge? |
Unfortunately, I don't have IE12 to test. |
Just want to drop a note here: pdfmake does not support IE currently: bpampuch/pdfmake#219 (comment) |
Yeah, I'm separately working on that: bpampuch/pdfmake#16 If I can either get them to return the file as a blob, or get them to implement our same crappy download code, then we would be able to use it on IE. |
Hey @PaulL1 I'm not sure if it's still relevant, but just to let you know - you can get the file as a blob using the following method: var document = pdfMake.createPdf(docDefinition);
document.getBuffer( function (buffer) {
blob = new Blob([buffer]);
}); |
Refer also #3642. I've implemented this code, which should result in IE getting a PDF downloaded, rather than attempting (and failing) opening the document. Of course, I don't have IE, so can't actually test it. :-) |
…r than trying to open
@PaulL1 not working on IE11 w/ latest unstable. |
Going to move this up to 3.1 as it seems to be an on-going issue and we need to move on 3.0. |
There's another issue out there with a fix on it I believe - can probably be applied quickly. Sent from my iPhone
|
I've applied the fix to #3642, closing this and leaving that open as the master. |
I have IE 10 version and getting following error when trying to export data in .pdf TypeError: Object doesn't support property or method 'defineGetter' Any help would be greatly appreciated. |
The pdf export feature is not working in Internet explorer. Does any one else have the same issue?
Thank you
The text was updated successfully, but these errors were encountered: