Skip to content

Commit 1f60f32

Browse files
committed
Add evaluateScript option to evaluate custom script in the context of the web page
1 parent d7ae243 commit 1f60f32

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/scripts/pdf_a4_portrait.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ page.onLoadFinished = function (status) {
5757
// The paperSize object must be set at once
5858
page.paperSize = definePaperSize(getContent(page), options)
5959

60+
// Evaluate custom JavaScript
61+
if (options.evaluateScript) page.evaluateJavaScript(options.evaluateScript)
62+
6063
// Output to parent process
6164
var fileOptions = {
6265
type: options.type || 'pdf',

0 commit comments

Comments
 (0)