express - Opening the print dialog from Typescript/ExpressJS -


i have requirement, have received pdf server (typescript + expressjs) , able display user on browser.

i need launch window.print() after pdf displayed.

my current code looks like

res.end(buffer.from(body.tostring('utf-8'), 'base64')); 

i tried various options, no use, problem response directly server pdf , no control on response.

i tried alter above code to

res.end(buffer.from(body.tostring('utf-8'), 'base64'), function(cb: any){   window.print(); }); 

but error

referenceerror: window not defined

is there way invoke window.print()?

update 1:

tried print() , got following error

referenceerror: print not defined       @ corkedrequest.finish (_stream_writable.js:548:7)      @ afterwrite (_stream_writable.js:388:3)      @ _combinedtickcallback (internal/process/next_tick.js:80:20)      @ process._tickcallback (internal/process/next_tick.js:98:9) 


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -