Photon Print button code

I hv a problem sending my .txt file to printer from my photon application.
When the print button is pressed, I tried sending the .txt file to the printer using cat command.But it did not work.Even cat comand did not work from command prompt.
On click of Print button from the Photon print menu, how is the selected file sent to printer?
Tell me how it can b done?