How to print a local file from printer in cocoa application?

My requirement is to print a local file in mac OS to be printed from printer programtically. Any lead is much appreciated

What type of file is it ?

Is your app sandboxed ?


So you want to print from your app.

Did you consider using a terminal command from within the app ?


Do you use Applescript ?

Did you see this: https://discussions.apple.com/thread/1903907

1.File can be any type : Word,Excel,PPT,Keynote,Text,RTF,Pages,numbers .
2. My App is not sandboxed
Yes i want to print from my aoo


I tried lp command in shell which is printing only PDF's


Apple script also i tried


M looking for swift framework , PDF kit is also printing obly PDF docs . I already posted below question regarding

How to print a non PDF document from MacOS using swift or shell script

How to print a local file from printer in cocoa application?
 
 
Q