How to create a button in a custom view, that prints the view?

How to create a button in a custom view, that prints the view?

I have a custom view, that's generated from a stateless form. I'd like to give user a button to print the data. I guess it can be a button in the stateless form?