Is it possible to "embed" an application (like Preview, Pages etc) into a Cocoa application? I would like to allow a user to view a PDF in my app with options to show/hide annotations, change the zoom level between page width and full page etc.
Is it possible to embed the Preview app within my Cocoa application? Couldn't find anything in the document or on the Internet which would suggest I could, so not sure.
Thanks.
You can embed an other application in the bundle of your application. You will usually do this to embed an other application you also created, like an helper, or a daemon. It sometimes is helpful, but doesn't seem to be what you want.
If you want to let the user play with a pdf inside your application, read the PDF Kit Programming Guide.
Especially look into the class PDFView
. You can drag and drop an instance into your xib, and load content into it with this code (from Apple documentation):
PDFDocument *pdfDoc;
pdfDoc = [[[PDFDocument alloc] initWithURL: [NSURL fileURLWithPath: [self fileName]]] autorelease];
[pdfView setDocument: pdfDoc];