I cannot seem to add an image to my PDF content using the iOS version of the library. My code follows. I have tried to open the document using a cache (as other topics on this forum suggest). I am noir sure if I have done it right or not.
Any help appreciated! Rather urgent. Thanks.
Here is how I open the document (seems to work OK):
m_doc = [[PDFDoc alloc] init];
NSString* tp = NSTemporaryDirectory();
//tp = [tp stringByAppendingPathComponent:@"cache"];
err = [m_doc open:path :pwd];
[m_doc setCache:tp];
Here is how I am adding the image:
UIImage* temp = [UIImage imageNamed:@"Signature"];
NSString* path = NSTemporaryDirectory();
path = [path stringByAppendingPathComponent:@"Signature.jpg"];
[UIImageJPEGRepresentation(temp, 0) writeToFile:path atomically:YES];
PDFDocImage* i = [m_doc newImageJPEG:path]; // always returns nil