Thank you all. I've figured out the solution. Here is the code that I used to get the visible portion of the image. (Keep it in your mind that the image was not fully visible when zoomed or pan due to it was taking entire screen)
- (UIImage *)cropVisiblePortionOfImageView:(UIImageView *)imageView {
CGFloat zoomScaleX=imageView.frame.size.width/initialWidth;
CGFloat zoomScaleY=imageView.frame.size.height/initialHeight;
CGSize zoomedSize=CGSizeMake(initialWidth*zoomScaleX,initialHeight*zoomScaleY);
UIGraphicsBeginImageContext(zoomedSize);
[imageView.image drawInRect:CGRectMake(0, 0, zoomedSize.width, zoomedSize.height)];
UIImage *zoomedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIGraphicsBeginImageContext(CGSizeMake(initialWidth, initialHeight));
[zoomedImage drawAtPoint:CGPointMake(imageView.frame.origin.x, imageView.frame.origin.y)];
UIImage *cropedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return cropedImage;
}