mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 08:01:53 +00:00
ipc new api, loadURL, image.toDataURL
This commit is contained in:
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