Multimedia

Java saat ini kelas PdfContentEditorExamples secara langsung mendukung addMovieAnnotation(...).

Menambahkan anotasi film

  1. Ikat PDF sumber ke fasad PdfContentEditor.
  2. Panggil createMovie(...) dengan persegi panjang anotasi, jalur file film, dan nomor halaman.
  3. Simpan dokumen PDF yang diperbarui.
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();
    }
}