mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-14 07:00:53 +00:00
ipc new api, loadURL, image.toDataURL
This commit is contained in:
2
node_modules/nedb_proxy.js
generated
vendored
2
node_modules/nedb_proxy.js
generated
vendored
@@ -81,7 +81,7 @@ DBProxy.prototype.remove = function (params, callback) {
|
||||
};
|
||||
|
||||
// m = {token: , err : , ret: }
|
||||
ipc.on('db-exec-ret', function(m) {
|
||||
ipc.on('db-exec-ret', function(event, m) {
|
||||
var token = m.token;
|
||||
var callback = token2Callback[token];
|
||||
// console.log('clent 接收到消息');
|
||||
|
6
node_modules/pdf_main.js
generated
vendored
6
node_modules/pdf_main.js
generated
vendored
@@ -10,12 +10,12 @@ var exportPdf = {
|
||||
});
|
||||
|
||||
// 写入html, 然后加载这个html
|
||||
win.loadUrl('file://' + htmlPath);
|
||||
win.loadURL('file://' + htmlPath);
|
||||
|
||||
win.webContents.on('did-finish-load', function() {
|
||||
console.log('load ok');
|
||||
setTimeout(function() {
|
||||
win.printToPDF({
|
||||
win.webContents.printToPDF({
|
||||
printBackground: true,
|
||||
landscape: false,
|
||||
pageSize: 'A4'
|
||||
@@ -45,7 +45,7 @@ var exportPdf = {
|
||||
|
||||
ipc.on('export-pdf', function(event, args) {
|
||||
// event.sender.send();
|
||||
console.log(args);
|
||||
// console.log(args);
|
||||
|
||||
me.export(args.htmlPath, args.targetPdfPath, args.isMarkdown, function (ok) {
|
||||
// console.log('导出pdf');
|
||||
|
Reference in New Issue
Block a user