Rich Media Annotation movie

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Rich Media Annotation movie

die_ekschperten
Hey guys,
I have some problems with embedding movies in pdf with Rich Media Annotations. I have an avi movie file which I'm trying to embed, but it does not work. The reader's annotation context menu always claims: "Movie not loaded." I am trying to achieve a movie player in pdf with some controls like play/pause button ... Is that possible with iText and Rich Media Annotation? I also tried mpeg as movie file - no success.
The code I am using is the following:

private void embedMovie() throws IOException
{
        String file = "src/video.avi";
        Rectangle rect = new Rectangle(0, 0, 400, 400);
        RichMediaAnnotation richMedia = new RichMediaAnnotation(writer,rect);
        // we embed the swf file
        PdfDictionary FileParameterDict = new PdfDictionary();
        PdfFileSpecification fs = PdfFileSpecification.fileEmbedded(writer, file, "movie", null, true, "video/ms-video", FileParameterDict);
        // we declare the swf file as an asset
        PdfIndirectReference asset = richMedia.addAsset("movie", fs);
                       
        RichMediaPresentation presentation = new RichMediaPresentation();
        presentation.setPassContextClick(new PdfBoolean(true));
        presentation.setStyle(PdfName.EMBEDDED);
                       
        // we create a configuration
        RichMediaConfiguration configuration = new RichMediaConfiguration(new PdfName("RichMediaConfiguration"));
        configuration.put(PdfName.SUBTYPE, PdfName.VIDEO);
        RichMediaInstance instance = new RichMediaInstance(PdfName.VIDEO);
        instance.setAsset(asset);
        configuration.addInstance(instance);
                       
        // we add the configuration to the annotation
        PdfIndirectReference configurationRef = richMedia.addConfiguration(configuration);
        // activation of the rich media
        RichMediaActivation activation = new RichMediaActivation();
                       
        activation.setCondition(new PdfName("PV"));
        activation.setConfiguration(configurationRef);
        activation.setPresentation(presentation);
                       
        RichMediaDeactivation deActivation = new RichMediaDeactivation();
        deActivation.setCondition(new PdfName("XD"));
        richMedia.setActivation(activation);
        richMedia.setDeactivation(deActivation);
       
        // we add the annotation
        PdfAnnotation richMediaAnnotation = richMedia.createAnnotation();
        writer.addAnnotation(richMediaAnnotation);
}

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Rich Media Annotation movie

Leonard Rosenthol-3
RichMedia is for Flash/SWF and 3D content.

If you are using an avi file, you need ot use the classic multimedia types (screen/rendition).

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: Tuesday, November 16, 2010 3:56 AM
To: [hidden email]
Subject: [iText-questions] Rich Media Annotation movie

Hey guys,
I have some problems with embedding movies in pdf with Rich Media Annotations. I have an avi movie file which I'm trying to embed, but it does not work. The reader's annotation context menu always claims: "Movie not loaded." I am trying to achieve a movie player in pdf with some controls like play/pause button ... Is that possible with iText and Rich Media Annotation? I also tried mpeg as movie file - no success.
The code I am using is the following:

private void embedMovie() throws IOException
{
        String file = "src/video.avi";
        Rectangle rect = new Rectangle(0, 0, 400, 400);
        RichMediaAnnotation richMedia = new RichMediaAnnotation(writer,rect);
        // we embed the swf file
        PdfDictionary FileParameterDict = new PdfDictionary();
        PdfFileSpecification fs = PdfFileSpecification.fileEmbedded(writer, file, "movie", null, true, "video/ms-video", FileParameterDict);
        // we declare the swf file as an asset
        PdfIndirectReference asset = richMedia.addAsset("movie", fs);
                       
        RichMediaPresentation presentation = new RichMediaPresentation();
        presentation.setPassContextClick(new PdfBoolean(true));
        presentation.setStyle(PdfName.EMBEDDED);
                       
        // we create a configuration
        RichMediaConfiguration configuration = new RichMediaConfiguration(new PdfName("RichMediaConfiguration"));
        configuration.put(PdfName.SUBTYPE, PdfName.VIDEO);
        RichMediaInstance instance = new RichMediaInstance(PdfName.VIDEO);
        instance.setAsset(asset);
        configuration.addInstance(instance);
                       
        // we add the configuration to the annotation
        PdfIndirectReference configurationRef = richMedia.addConfiguration(configuration);
        // activation of the rich media
        RichMediaActivation activation = new RichMediaActivation();
                       
        activation.setCondition(new PdfName("PV"));
        activation.setConfiguration(configurationRef);
        activation.setPresentation(presentation);
                       
        RichMediaDeactivation deActivation = new RichMediaDeactivation();
        deActivation.setCondition(new PdfName("XD"));
        richMedia.setActivation(activation);
        richMedia.setDeactivation(deActivation);
       
        // we add the annotation
        PdfAnnotation richMediaAnnotation = richMedia.createAnnotation();
        writer.addAnnotation(richMediaAnnotation);
}

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
iText-questions mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Rich Media Annotation movie

Kirthi
Hello!

Anyone please let me know how do I embed a mpeg/mp4 file into the PDF with playback controls using iText Rich media?

As mentioned here, I am able to embed only Flash file without any errors.however it has no play/pause buttons.

Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Rich Media Annotation movie

blowagie
Nabble isn't an official iText forum. Read http://itextpdf.com/support to find out where to post a question.
Loading...