How to print with printer on desktop Kotlin

how I print on thermal printer on desktop or use desktop print api like we use in browser ctrl+p