Multimedia
Contents
[
Hide
]
The current Java PdfContentEditorExamples class directly supports addMovieAnnotation(...).
Add a movie annotation
- Bind the source PDF to the
PdfContentEditorfacade. - Call
createMovie(...)with the annotation rectangle, movie file path, and page number. - Save the updated PDF document.
public static void addMovieAnnotation(Path inputFile, Path movieFile, Path outputFile) {
PdfContentEditor editor = new PdfContentEditor();
try {
editor.bindPdf(inputFile.toString());
editor.createMovie(new Rectangle(80, 500, 220, 120), movieFile.toString(), 1);
editor.save(outputFile.toString());
} finally {
editor.close();
}
}