From 14736c5f309d3e51f41647fba976f9516d3b0f2f Mon Sep 17 00:00:00 2001 From: universalstrapping <90921972+universalstrapping@users.noreply.github.com> Date: Mon, 18 Oct 2021 20:53:59 -0400 Subject: [PATCH] Avoid Undefined Variable In printToPdf Example (#31455) --- docs/api/web-contents.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 0e7927c7c734..4d8346bd2c72 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -1485,8 +1485,8 @@ win.loadURL('http://github.com') win.webContents.on('did-finish-load', () => { // Use default printing options + const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf') win.webContents.printToPDF({}).then(data => { - const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf') fs.writeFile(pdfPath, data, (error) => { if (error) throw error console.log(`Wrote PDF successfully to ${pdfPath}`)