Skip to content

Commit

Permalink
Merge pull request #2948 from PaulL1/2921_ie_pdf_export
Browse files Browse the repository at this point in the history
Fix(exporter): fix #2921 download rather than open pdf in IE
  • Loading branch information
PaulL1 committed Mar 9, 2015
2 parents ae3be68 + 3a9327f commit f82c65b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions misc/tutorial/206_exporting_data.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ the grid menu using the gridOption `enableGridMenu`

Note that the option to export selected data is only visible if you have data selected.

If you are using internet explorer then the pdf will automatically download rather than opening,
there are issues with pdfMake not being able to automatically open tabs in internet explorer
(refer https://github.com/bpampuch/pdfmake/issues/16 and other issues in that repo).

@example
In this example we use the native grid menu buttons, and we show both the pdf and csv export options.

Expand Down
6 changes: 5 additions & 1 deletion src/features/exporter/js/exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,11 @@
var exportData = this.getData(grid, rowTypes, colTypes);
var docDefinition = this.prepareAsPdf(grid, exportColumnHeaders, exportData);

pdfMake.createPdf(docDefinition).open();
if (this.isIE()) {
pdfMake.createPdf(docDefinition).download();
} else {
pdfMake.createPdf(docDefinition).open();
}
},


Expand Down

0 comments on commit f82c65b

Please sign in to comment.