ipc new api, loadURL, image.toDataURL

This commit is contained in:
life
2016-05-22 15:15:27 +08:00
parent 15c2f75be9
commit faa9f8b308
6 changed files with 21 additions and 18 deletions

6
node_modules/pdf_main.js generated vendored
View File

@@ -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');