Pdf - Pdf3DAnimationType

18 Nov 20261 minute to read

Defines the animation types available for a PDF 3D view.

// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data);
// Access the first page
let page: PdfPage = document.getPage(0) as PdfPage;
// Create a 3D annotation with U3D data
let annotation3D: Pdf3DAnnotation = new Pdf3DAnnotation(page, { x: 50, y: 350, width: 200, height: 200 });
// Set the animation type
annotation3D.animationStyle.animationType = Pdf3DAnimationType.Linear;
// Add the annotation to the page
page.annotations.add(annotation3D);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();
  • Linear - Specifies linear animation.
  • None - Specifies no animation.
  • Oscillating - Specifies oscillating animation.