Embedded Image / Video Support

I’m interested in the PDF.Net library to compose a pdf document along with a few images png and videos for a report. My minimum requirement would be to embedded the images / videos and display a link to allow the user to open/save them and view them on a PC. Or preferred feature to view both types inline within adobe reader itself. What are the current capabilities of the lastest library? I see mixed information on the support channel.

@matts123

Aspose.PDF offers RichMediaAnnotation which can be used to play media stored within PDF document. There is also MovieAnnotation which can play link to the external video file (placed on disk or internet).

In fact RichMediaAnnotation is container for SWF (Flash) script. Due to license restriction we can not include third-party flash scripts in our product, so you should provide your script for playing video or audio. For example you can use VideoPlayer and AudioPlayer shipped with Adobe Acrobat. It is placed in Acrobat folder Acrobat\Multimedia Skins\Players.

Please check following sample code for embedding video/audio files in PDF document using RichMediaAnnotation.

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
Page page = doc.Pages.Add();
RichMediaAnnotation rma = new RichMediaAnnotation(page, new Aspose.Pdf.Rectangle(100, 500, 300, 600));
//here we should specify stream containing code of the video player
rma.CustomPlayer = new FileStream(@"Acrobat\Multimedia Skins\Players\Videoplayer.swf",FileMode.Open, FileAccess.Read);
//give name to video data. This data will be embedded into document with this name and referenced from flash variables by this name.
// videoName should not contain path to the file; this is rather "key" to access data inside of the PDF document
string videoName = "VideoTutorial.mp4";
//also we use skin for video player
string skinName = "SkinOverAllNoFullNoCaption.swf";
//compose flash variables line for player. please note that differnet players may have different format of the flash variabless line. Refer to documentation for your player.
rma.CustomFlashVariables = String.Format("source={0}&skin={1}", "VideoTutorial.mp4", skinName);
//add skin code.
rma.AddCustomData(skinName, new FileStream(@"Acrobat\Multimedia Skins\SkinOverAllNoFullNoCaption.swf", FileMode.Open, FileAccess.Read));
//set poster for video
rma.SetPoster(new FileStream(myDir + "Aspose.jpg", FileMode.Open, FileAccess.Read));
Stream fs = new FileStream(myDir + videoName, FileMode.Open, FileAccess.Read);
//set video content
rma.SetContent(videoName, fs);
//set type of the content (video)
rma.Type = RichMediaAnnotation.ContentType.Video;
//active player by click
rma.ActivateOn = RichMediaAnnotation.ActivationEvent.Click;
//update annotation data. This method should be called after all assignments/setup. This method initializes data structure of the annotation and embeds required data.
rma.Update();
//add annotation on the page.
page.Annotations.Add(rma);
doc.Save(myDir + “39606-1.pdf”); 

Furthermore, please check following article(s) in API documentation to add images inside PDF document: