Pdf - Pdf3DLightingStyle

18 Nov 20261 minute to read

Defines the lighting styles available for 3D artwork.

// 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 lighting style
annotation3D.renderMode.lightingScheme = Pdf3DLightingStyle.Day;
// Add the annotation to the page
page.annotations.add(annotation3D);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();
  • Artwork - Uses the lights specified in the 3D artwork.
  • Blue - Uses three blue infinite lights.
  • CAD - Uses three grey infinite lights and one camera-attached light.
  • Cube - Uses six grey infinite lights aligned with the major axes.
  • Day - Uses three light-grey infinite lights.
  • Hard - Uses three grey infinite lights.
  • Headlamp - Uses a single infinite light attached to the camera.
  • Night - Uses yellow, aqua, and blue infinite lights.
  • None - Ignores the lighting specified in the 3D artwork.
  • Primary - Uses red, green, and blue infinite lights.
  • Red - Uses three red infinite lights.
  • White - Uses three blue-grey infinite lights.