Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Общие вопросы по .NET и C# > PDF + Flash


Автор: alder 9.10.2007, 10:56
заембедил Flash ролик в PDF файл (использую iTextSharp), работает, не нравиться только то что Flash ролик должен быть рядом с PDF.

Как можно Flash ролик полностью засунуть/вшить в PDF файл (то есть чтобы PDF содержал в себе Flash файл)?

Автор: alder 10.10.2007, 06:18
отвечу сам себе 

Код

            Document document = new Document(PageSize.A4, 50, 50, 50, 50);
            PdfWriter writer = PdfWriter.GetInstance(document, new
            FileStream("test2.pdf", FileMode.Create));
            writer.SetPdfVersion(PdfWriter.PDF_VERSION_1_5);
            document.Open();
            PdfContentByte cb = writer.DirectContent;
            //cb.SetColorStroke(iTextSharp.text.Color.RED);
            //cb.Rectangle(150, 500, 450, 800);
            cb.Stroke();
            //document.Add(new Paragraph("Images"));
            PdfFileSpecification fs = PdfFileSpecification.FileEmbedded(writer,
            "opening_animation.swf", "opening_animation.swf", null);
            PdfAnnotation annot = PdfAnnotation.CreateScreen(writer, new
            iTextSharp.text.Rectangle(150f, 500f, 450f, 800f),
            "opening_animation.swf", fs, "application/x-shockwave-flash", true);
            writer.AddAnnotation(annot);
            document.Close(); 

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)