Hello there, have you ever used itextsharp? Its a beautiful library, it was a java library ported to c#.
http://sourceforge.net/projects/itextsharp/[
^]
The sample code i've got below is for embedding a swf file into a pdf. With this sameple you should be able to try whatever other formats you may have and see if they will work by importing them into a pdf.
Please let me know if you have any questions.
Usings
using System;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.pdf.richmedia;
Code
static void Main(string[] args)
{
CreatePdfWithMedia(@"C:\temp\test.pdf");
}
public static void CreatePdfWithMedia(string file)
{
string day = DateTime.Now.ToString("dd/MM/yyyy");
Document document = new Document();
PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(file, FileMode.Create));
writer.SetPdfVersion(PdfWriter.PDF_VERSION_1_7);
writer.AddDeveloperExtension(PdfDeveloperExtension.ADOBE_1_7_EXTENSIONLEVEL3);
document.Open();
RichMediaAnnotation media = new RichMediaAnnotation(writer, new Rectangle(36, 400, 559, 806));
PdfFileSpecification fs = PdfFileSpecification.FileEmbedded(writer, @"C:\temp\test.swf", "1.swf", null);
PdfIndirectReference asset = media.AddAsset("1.swf", fs);
RichMediaConfiguration configuration = new RichMediaConfiguration(PdfName.FLASH);
RichMediaInstance instance = new RichMediaInstance(PdfName.FLASH);
RichMediaParams flashVars = new RichMediaParams();
String vars = day;
flashVars.FlashVars = vars;
instance.Params = flashVars;
instance.Asset = asset;
configuration.AddInstance(instance);
PdfIndirectReference configurationRef = media.AddConfiguration(configuration);
RichMediaActivation activation = new RichMediaActivation();
activation.Configuration = configurationRef;
media.Activation = activation;
PdfAnnotation richMediaAnnotation = media.CreateAnnotation();
richMediaAnnotation.Flags = PdfAnnotation.FLAGS_PRINT;
writer.AddAnnotation(richMediaAnnotation);
document.Close();
}