Skip to content

Commit

Permalink
Add workaround for printing
Browse files Browse the repository at this point in the history
On macOS, it should be possible to print a PDF file without an
installed printer. But the Electron framework prevents this.

See electron/electron#36897
for more information.
  • Loading branch information
luxuereal committed Feb 25, 2023
1 parent a94cba0 commit 6bb9161
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ function createMainMenu() {
label: "&Print",
accelerator: "CmdOrCtrl+P",
click() {
_mainWindow.webContents.print()
// Workaround for Electron issue, see
// https://github.com/electron/electron/issues/36897
_mainWindow.webContents.executeJavaScript("window.print();")
},
},
{ type: "separator" },
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mdview",
"version": "2.5.1",
"version": "2.5.2",
"description": "Standalone Markdown Viewer",
"keywords": [
"markdown",
Expand Down

0 comments on commit 6bb9161

Please sign in to comment.