Well the pdf is in a writable directory.But I am not sure if the image is saved properly or not.Here is my code.
That's how I call the add method :
- (NSData *)vAddImage:(NSData *)data withRect:(PDF_RECT)rect
{
NSString *tp = NSTemporaryDirectory();
tp = [tp stringByAppendingPathComponent:@"cache.dat"];
[m_doc setCache:tp];
PDFPage *page = [m_doc page:m_cur_page];
CGImageRef ref = [UIImage imageWithData:data].CGImage;
[page addAnnotBitmap:ref :NO :&rect];
[m_view vRenderSync:m_cur_page];
[self refresh];
[m_doc save];
NSData *pdfData = [[NSFileManager defaultManager]contentsAtPath: fullPath];
return pdfData;
}
Please tell me;is there something missing in my code above for adding and saving the image into pdf?