export pdf local ok

This commit is contained in:
life
2015-12-21 23:25:36 +08:00
parent 743e752d08
commit 73584c8ff1
10 changed files with 1907 additions and 3 deletions

10
main.js
View File

@@ -1,6 +1,7 @@
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
var ipc = require('ipc');
var ipc = require('ipc');
var pdfMain = require('pdf_main');
// Report crashes to our server.
require('crash-reporter').start();
@@ -87,6 +88,7 @@ function openIt() {
var leanoteProtocol = require('leanote_protocol');
leanoteProtocol.init();
// Create the browser window.
mainWindow = new BrowserWindow({
width: 1050,
@@ -96,6 +98,8 @@ function openIt() {
}
);
console.log('load: file://' + __dirname + '/note.html');
// and load the index.html of the app.
mainWindow.loadUrl('file://' + __dirname + '/note.html');
@@ -123,11 +127,13 @@ function openIt() {
e.preventDefault();
mainWindow.webContents.send('closeWindow');
});
// 前端发来可以关闭了
ipc.on('quit-app', function(event, arg) {
console.log('get quit-app request');
mainWindow.destroy();
mainWindow = null;
});
pdfMain.init();
}