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.
Properties
Section titled “Properties”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 |
Events
Section titled “Events”Sent to the entity’s Signal Emitter as { entityId, eventType, data }. Compare eventType with the EventType constants.
PDF::readyPDF::errorPDF::page
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Turn pages with the arrow keysA presenter's screen shows a PDF slide deck; the left and right arrow keys turn its pages, stopping at the first and last, with the page count read from the PDF::ready event.
Click the view, then press the right and left arrow keys to turn the pages. The arrow keys do not move the camera here; drag to orbit, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(PDFComponent); if (component) log(component.props);}