These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Flash Video Streaming in Adobe 9

Amy
Registered: Nov 21 2007
Posts: 7

New to adding videos to a pdf and need to know how it will effect the bandwidth on my web server. Created a sample pdf with an embedded 5 minute video in it. If this file is accessed from a web page does the pdf file stream the video on the web server or the client pc? Is it treated by the web server as a normal pdf and therefore no worries about the bandwidth?

Thanks for any help/imformation.

My Product Information:
Acrobat Pro Extended 9.0, Windows
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
If the video clip is embedded then it becomes part of the PDF as far as the server is concerned - it'll just be a bigger PDF. The client downloads the PDF and then it plays back locally, so there's no streaming taking place. If they watch the video twice, they don't download it again.

As to 'no worries about the bandwidth' - the quantity of data sent to the client is the same no matter how you deliver the video, so if you've taken a 10kb PDF and added a 5Mb video to it, every [i]new[/i] download of that file will hit your server for the full 5Mb, but of course you don't care how many times they watch it, or how many people they email the file to.
joshcorey
Registered: Jul 14 2008
Posts: 79
If you want the file size of the PDF to be smaller you can use a URL to your video (as long as it is encoded with H.264 or is an FLV/SWF). In the end the data sent down to the user is the same size but the PDF will load quicker and then the video content is only streamed if/when the user activates it. You can use a URL as the source when you add video with the "Video Tool".
anishlodha04
Registered: Aug 1 2011
Posts: 2
Hi, i am trying to embed fusion chart into a pdf and the swf file requires a xml file to generate chart...After embedding i could not see any chart.
Help me out in passing the xml file in the pdf so that swf can use it and generate charts.
hereby i am attaching the code...please help me out

package com.embedflash;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.Rectangle;
import com.itextpdf.text.pdf.PdfAnnotation;
import com.itextpdf.text.pdf.PdfDeveloperExtension;
import com.itextpdf.text.pdf.PdfFileSpecification;
import com.itextpdf.text.pdf.PdfIndirectReference;
import com.itextpdf.text.pdf.PdfName;
import com.itextpdf.text.pdf.PdfNameTree;
import com.itextpdf.text.pdf.PdfWriter;
import com.itextpdf.text.pdf.interfaces.PdfVersion;
import com.itextpdf.text.pdf.richmedia.RichMediaActivation;
import com.itextpdf.text.pdf.richmedia.RichMediaAnnotation;
import com.itextpdf.text.pdf.richmedia.RichMediaConfiguration;
import com.itextpdf.text.pdf.richmedia.RichMediaInstance;
import com.itextpdf.text.pdf.richmedia.RichMediaParams;

class EmbedParam {

private static final String testXML = "dataXml=<?xml version=1.0?> ";EmbedParam() {
Document doc = new Document();
try {
FileOutputStream fos = new FileOutputStream("result12.pdf");
PdfWriter writer = PdfWriter.getInstance(doc, fos);
writer.setPdfVersion(PdfWriter.PDF_VERSION_1_7);
writer
.addDeveloperExtension(PdfDeveloperExtension.ADOBE_1_7_EXTENSIONLEVEL3);
doc.open();
RichMediaAnnotation media = new RichMediaAnnotation(writer,
new Rectangle(800, 800, 800, 800));
PdfFileSpecification fs = PdfFileSpecification.fileEmbedded(writer,
"Column3D.swf", "result12.pdf", null);
PdfIndirectReference asset = media.addAsset("Column3D.swf", fs);
RichMediaConfiguration config = new RichMediaConfiguration(
PdfName.FLASH);
RichMediaInstance instance = new RichMediaInstance(PdfName.FLASH);
RichMediaParams flashVars = new RichMediaParams();
String vars = new String(testXML);
flashVars.setFlashVars(vars);
instance.setParams(flashVars);
instance.setAsset(asset);
config.addInstance(instance);
PdfIndirectReference configRef = media.addConfiguration(config);
RichMediaActivation activation = new RichMediaActivation();
activation.setConfiguration(configRef);
media.setActivation(activation);
PdfAnnotation mediaanote = PdfAnnotation.createScreen(writer,
new Rectangle(200f, 700f, 400f, 800f), "Column3D.swf", fs,
"application/x-shockwave-flash", true);

mediaanote.setFlags(PdfAnnotation.FLAGS_PRINT);
writer.addAnnotation(mediaanote);
doc.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (DocumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
doc.close();
}
}

public static void main(String[] args) {
EmbedParam e = new EmbedParam();
}

}

UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
For an XML file to be visible to the SWF it must be attached as a Resource object to the rich media annotation - and then from inside the SWF it can be loaded as if it's in the same folder (i.e. no pathnames required).
anishlodha04
Registered: Aug 1 2011
Posts: 2
Hey thanx for ur support...but i am very new to flash and itext so can u help me out by giving a snippet to pass xml file to swf file in itext...

Thanx in advance
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
We don't provide any help for iText on these forums, only for Adobe software. iText have their own fee-based support system for technical questions.