How to print a file in cocoa application depending upon its mime type?

95 views Asked by At

I am working on file manager. I have stored their local urls in my core data. I have file and folder, but I want to print png, jpeg, docx and pdf from my application. Let's suppose I have a print button in my application and every file, how can I print that?

1

There are 1 answers

1
mahal tertin On

use launch services LSOpenFromURLSpec as described in the reference. pass kLSLaunchAndPrint as launch option in the specs array.