RichMediaAnnotation Class
A PDF rich media annotation.
Declaration
public class RichMediaAnnotation extends BaseAnnotation
Remarks
A rich media annotation embeds multimedia content (for example, video, audio, or 3D content) in a PDF page. When the API loads a document, it creates RichMediaAnnotation objects for rich media annotations in the document.
Note
The PDF Document API does not create rich media annotations and does not modify rich media content.
Call the Page.getAnnotations() method to access annotations on a page.
Refer to the following help topic for additional information: File and Multimedia Annotations.
Example
Remove Rich Media Annotations from a PDF Document
The following code snippet removes rich media annotations from all pages of a document:
import java.io.*;
import java.nio.file.*;
import java.util.*;
import com.devexpress.docs.pdf.*;
public class Main {
public static void main(String[] args) throws Exception {
Files.createDirectories(Path.of("output"));
try (InputStream inputStream = Files.newInputStream(Path.of("Document.pdf"));
PdfDocument pdfDocument = new PdfDocument(inputStream)) {
for (Page page : pdfDocument.getPages()) {
// Find rich media annotations on the page.
List<BaseAnnotation> richMedia = new ArrayList<>();
for (BaseAnnotation annotation : page.getAnnotations())
if (annotation instanceof RichMediaAnnotation)
richMedia.add(annotation);
// Remove the annotations from the page.
for (BaseAnnotation annotation : richMedia)
page.getAnnotations().remove(annotation);
}
try (OutputStream outputStream = Files.newOutputStream(Path.of("output", "Document.pdf"))) {
pdfDocument.save(outputStream);
}
}
}
}
Inherited Members
com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)
Inheritance
Object
JavaObject
TrackedObject
BaseAnnotation
RichMediaAnnotation