Knowledge Base and examples

Knowledge Base - Add Rich Media Annotations

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];

 

Applies To

RadaeePDF SDK for iOS

Details

Created : 2016-09-19 10:55:11, Last Modified : 2016-09-19 10:55:11