If it is an UIImage that you are talking about - that does have build-in methods for writing it's contents to a file and for fetching the image as png or jpeg data stream. See the UIImage class reference for details.
AFAIK there is no bild-in function for exporting into PDF. You could of course create a PDF and draw the image into it. This is tutorial is easy to understand and it does include drawing an image: http://www.ioslearner.com/generate-pdf-programmatically-iphoneipad/
Edit in response to your comment. The response is too large for a comment:
I did a similar thing with a GL layer once. In your case it should be easier. How to get an UIImage from a view's layer is discussed here Convert UIView Layer to UIImage and here How to convert UIView as UIImage? . Once you have it stored in an UIImage see its reference here http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImage_Class/Reference/Reference.html . It tells you that there are UIKit functions available (not methods as I said before) that convert UIImages to JPEG and PNG: UIImagePNGRepresentation
and UIImageJPEGRepresentation
that are documented here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIKitFunctionReference/Reference/reference.html#//apple_ref/c/func/UIImagePNGRepresentation . These functions return NSData objects.
NSData is documented here: https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/Reference/Reference.html
It comes with metods to write the data to a file. writeToFile:atomically:
for instance.
Here is an example. In my case I just needed a unique file name and decided to take a timestamp. You may want to use some more user friendly file name here.
// Use current time stamp for some unique photo ID
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *pathToDocuments=[paths objectAtIndex:0]; // this returns the path to the App's document directory
NSString *photoID = [NSString stringWithFormat:@"%f", [[NSDate date] timeIntervalSince1970]]; // this is just a time stamp. This is what you are most likely to do different.
NSString *fileName = [NSString stringWithFormat:@"%@/%@.jpg", pathToDocuments, photoID]; // now you have a fully qualified path to a file within that part of the file system that belongs to your app. It will be overwritten if it exists.
// Actually save the image (JPEG)
NSData *imgData = UIImageJPEGRepresentation(theImage, 1); // convert to jpeg - 1.0 represents 100%
[imgData writeToFile:fileName atomically:YES]; // actually save the data.