I used a local action to open a modal dialog. In this modal dialog section, I have a button which I am using for printing the pop-up window.
I am using window.print() to print the contents of the pop-up window. It is working for me. Please see the attached snapshots for better understanding. Please let me know in case there is some misunderstanding.