Skip to content

PDF

Updated

Shows the pages of a PDF document.

Type
comp-pdf
Script class
PDFComponent
Per entity
One
Version
1.0.0

Read about it in Documents: what it does, how to use it from a script, and examples.

The props the runtime declares for this component, with their defaults and accepted ranges.

Prop Default Range
height 0 ≤ x ≤ 10000
page 1 ≤ x ≤ 9007199254740991, integer
width 0 ≤ x ≤ 10000

Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.

  • PDF::ready
  • PDF::error
  • PDF::page

Run it in the browser, read its scripts, and download it as an XR Creator project.

#pragma lifecycle(startup)
function startup() {
const component = self.parent.getComponent(PDFComponent);
if (component) log(component.props);
}