Frequently Asked Question
Add Rich Media Annotations (iOS)
Last Updated 11 months ago
This article shows how to add rich media annotations:
Remember that to use the following methods you need a Premium license.
//remember to set the cache file (only if is not set before) NSString *cacheFile = [[NSTemporaryDirectory() stringByAppendingString:@""] stringByAppendingString:@"cache.dat"];
[m_doc setCache:cacheFile]; //get the pdf page
PDFPage *page = [m_doc page:m_cur_page];
//create the icon PDFDocImage *img = [m_doc newImageJPEG:[[NSBundle mainBundle] pathForResource:@"icon" ofType:@"jpg"]];
//set the icon position/size
PDF_RECT rect; rect.left = 100;
rect.top = 100; rect.right = 150;
rect.bottom = 150;
//add the rich media [page addAnnotRichMedia:@"" :[[NSBundle mainBundle] pathForResource:@"video" ofType:@"mp4" inDirectory:@"fdat"] :0 :img :&rect];