NSRect r = [mSnapshotView bounds];
NSData *data = [mSnapshotView dataWithPDFInsideRect:r];
NSImage *image = [[NSImage alloc] initWithData:data];
NSData *imageData = [image TIFFRepresentation];
NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:imageData];
NSNumber *compressionFactor = [NSNumber numberWithFloat:0.9];
NSDictionary *imageProps = [NSDictionary dictionaryWithObject:compressionFactor forKey:NSImageCompressionFactor];
imageData = [imageRep representationUsingType:NSJPEGFileType properties:imageProps];
[imageData writeToFile:path atomically:NO];