How to call print trigger function in custom button of doctype

not exactly, i did find a workaround though. This is my own post about that.