Hi all,
I have created one swf file, in which it will run with the help of
some external files (5 mp3 files, 2 xml files, and 6 image files). When I
have create the pdf using itext I can only able to embedded the swf file
alone. How should able to add these external files to run the swf. It
would be helpful if you give some sample. Can you please help me where
should i have to add the values for adding the image,mp3 and xml files to
run the swf.
*My code is below :*
PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("welcome.pdf"));
writer.setPdfVersion(PdfWriter.PDF_VERSION_1_7);
writer.addDeveloperExtension(PdfDeveloperExtension.ADOBE_1_7_EXTENSIONLEVEL3);
document.open();
RichMediaAnnotation richMedia = new RichMediaAnnotation(writer,
new Rectangle(36, 400, 559,806));
PdfFileSpecification fs =
PdfFileSpecification.fileEmbedded(writer, "ballon.swf", "ballon.swf", null);
PdfIndirectReference asset = richMedia.addAsset("ballon.swf", fs);
RichMediaConfiguration configuration = new
RichMediaConfiguration(PdfName.FLASH);
RichMediaInstance instance = new RichMediaInstance(PdfName.FLASH);
RichMediaParams flashVars = new RichMediaParams();
String vars = new String("&day=2011-10-13");
flashVars.setFlashVars(vars);
instance.setParams(flashVars);
instance.setAsset(asset);
configuration.addInstance(instance);
PdfIndirectReference configurationRef =
richMedia.addConfiguration(configuration);
RichMediaActivation activation = new RichMediaActivation();
activation.setConfiguration(configurationRef);
richMedia.setActivation(activation);
PdfAnnotation richMediaAnnotation = richMedia.createAnnotation();
richMediaAnnotation.setFlags(PdfAnnotation.FLAGS_PRINT);
writer.addAnnotation(richMediaAnnotation);
document.close();
Thanks in advance,
Shri Saravanan
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
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