-
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
Export to PDF throws "Permission is denied" #3642
Comments
The 206 tutorial is up to date, running the latest unstable code. Where does the error message show up? In the console? Or in an alert? Also, is "Access is denied" the full error message? If you have an error in the console can you post a screenshow or text chunk of the stack trace? |
Thank you for confirming the 206 tutorial is up to date. I just realized that I did not mention this is working in Chrome & FF locally. All 3 Chrome, IE, and FF (developer edn) work on your site. Locally only IE 11 does not work for me. The full error message is as follows that shows up while debugging IE 11 with Visual Studio 2013. Unhandled exception at line 109, column 5 in http://localhost/MVCTesting/Scripts/ThirdParty/PDFMake/pdfmake.js 0x800a0046 - JavaScript runtime error: Permission denied When not debugging with VS only a blank page for the new tab shows up. UPDATE: If the developer tools are open you can see the same error as with VS 2013. |
I see where I thought it was "Access is denied". When I copied the pdf bytes and created a test to open the new window directly using the following code...
without doing the processing I receive the following error. Exception was thrown at line 40, column 3 in http://localhost/MVCTesting/Scripts/AngularJS/controlls/exportToPdfCsvCtrl.js 0x80070005 - JavaScript runtime error: Access is denied. This works for Chrome and FF as well but fails in IE 11. |
My understanding is that IE doesn't allow window.open, and therefore that pdf doesn't currently work with IE. I have planned a fix that grabs the PDF content, and then offers a download the same as the csv file, I'll implement that today. |
…r than trying to open
I've pushed this - you could test it if you had availability to do so (I still don't have IE). |
Thank you for pushing this. Sorry for the delay in responding I was in KS no man's land over the weekend with no service. I downloaded RC.21 and replaced the ui.grid.exporter with the Fix(exporter) changes, lines 15256 to 16499 replaced with the link from above. I used the menu to download a PDF, I did not receive an error or a PDF. I was able to debug all of the code to the This is not working, but I have a fix. P.S. NICELY DONE, for not having debugging in IE. It was so close I just moved the code a bit. In the downloadPDF there is an anonymous funciton doc.getBuffer that initializes the blob variable. However, the process continues till that function is called with the buffer. The IE check is fired with a null blob. I moved the ie check inside the anonymous function like so.
|
Excellent, thanks. I'll update tonight. |
I am attempting to use the Export to PDF. I am able to get it to work on the site, however, when I copy the example from http://ui-grid.info/docs/#/tutorial/206_exporting_data and export to PDF I receive an "Access is denied" error message. The only changes that I made to the tutorial was to remove touch and animate.
I traced the error to pdfmake.js. In the Document.portotype.open the win.location.href = result; is where the error happens. I found something that is close to the issue, this question uses iframes, http://stackoverflow.com/questions/1886547/access-is-denied-javascript-error-when-trying-to-access-the-document-object-of. Normally I would contact the creators of pdfmake except I am able to get the PDF to work on your site.
To try to fix the issue I copied the result string for the PDF and tried a window open in some test code. I tried the solution in the SO post, but modified from an iframe to a window. I also tried opening without a new tab in JS.
Do you have an update for the 206 tutorial that is closer to the demo on your site or is the tutorial already up to date?
If the tutorial is up to date, was there anything done special, either to pdfmake or your code that is not in the tutorial, to help get this to work?
Please let me know if you need any more information.
The text was updated successfully, but these errors were encountered: