Problem with Print onload page #13354
-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @jjhhrj, Automations are a backend feature. The In a backend Node.js environment, there is no window object because Node.js runs JavaScript code outside of a browser context. Node.js is typically used for server-side scripting rather than client-side scripting. Therefore, functions like window.print() won't work in a Node.js environment because there is no browser to interact with. If you need to generate printable content in a Node.js environment, you would typically use a library specifically designed for generating documents, such as pdfkit, puppeteer, or jsPDF, rather than relying on browser-specific functions like Alas, this won't work as its something we would need to add on our end. Hopefully this makes sense and is helpful for you. |
Beta Was this translation helpful? Give feedback.
Hey @jjhhrj,
Automations are a backend feature.
The
window.print()
function is a JavaScript function that is typically used in frontend environments, such as web browsers, to open the print dialog box and allow the user to print the current page. It is part of the Web APIs provided by web browsers.In a backend Node.js environment, there is no window object because Node.js runs JavaScript code outside of a browser context. Node.js is typically used for server-side scripting rather than client-side scripting. Therefore, functions like window.print() won't work in a Node.js environment because there is no browser to interact with.
If you need to generate printable content in a Node.js envir…