pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Bautista Magraner Bella <videoclock...@gmail.com>
Subject Embed a video in PDF
Date Fri, 03 Apr 2015 08:33:23 GMT
Hi guys!

I'm trying to create a PDF that shows an embedded screen of a quicktime
video I've attached on it.

I guess the initial source code for attaching the file is:

PDEmbeddedFilesNameTreeNode efTree = new PDEmbeddedFilesNameTreeNode();

//first create the file specification, which holds the embedded file
PDComplexFileSpecification fs = new PDComplexFileSpecification();
fs.setFile( "video.mov" );
InputStream is = ...;
PDEmbeddedFile ef = new PDEmbeddedFile(doc, is );
//set some of the attributes of the embedded file
ef.setSubtype( "video/quicktime" );
ef.setSize( data.length );
ef.setCreationDate( new GregorianCalendar() );
fs.setEmbeddedFile( ef );

//now add the entry to the embedded file tree and set in the document.
Map efMap = new HashMap();
efMap.put( "My first attachment", fs );
efTree.setNames( efMap );
//attachments are stored as part of the "names" dictionary in the document
catalog
PDDocumentNameDictionary names = new PDDocumentNameDictionary(
doc.getDocumentCatalog() );
names.setEmbeddedFiles( efTree );
doc.getDocumentCatalog().setNames( names );






Now I would like to show the screen of the video inside the PDF. How can I
get that?

Kind Regards,

V. Clock

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message