File Info
Access detailed metadata for the active document, synchronized in real-time with the canvas state.
File Info allows your application to retrieve technical metadata about the document currently being viewed. This includes physical dimensions, modification dates, and original source URLs.
By listening to metadata events, you can build custom UI elements such as details panels, breadcrumbs, or audit logs that adapt to the active file's properties.
- Real-Time Updates: Metadata is emitted automatically on load and during active file switches.
- Physical Dimensions: Access logical width and height attributes of CAD and PDF drawings.
- Source Tracking: Track original URL domains to correlate with external databases.
Subscribe to metadata changes and inspect the file information:
Listen for fileInfo updates
Metadata broadcast follows a stable state event flow:
1. Canvas Emits metadata
The canvas broadcasts the fileInfo event after parsing a file or switching tabs.
2. Host Renders Properties
The host application processes dimensions and formats timestamps for user presentation.
Safely compile property listings and resolve null cases:
- `activeId` vs Labels: Always match documents using the unique
activeIdparameter, notnameortitledisplay strings. - Open Result Callback:
viewer.documents.open(...)resolves directly with the first parsed file metadata snapshot, allowing immediate extraction. - Type Guarding Dimensions: The
width,height, anddateproperties are typed asunknownsince they vary by file type. Verify their type (e.g.,typeof value === "number") before computing sizes.
Copy these project setup files to configure mounting, event subscriptions, and details panel rendering:
Subscribe to metadata changes and render custom labels inside a React component:
Subscribe to metadata changes and render details in a Vue Composition template:
Subscribe to metadata changes and render details in an Angular component structure:
Use the interactive preview below to inspect the real-time payload emitted when you switch or open files.
Interactive Workbench
File info preview
Track the active file metadata emitted by the Canvas in real time.
Keep metadata workflows aligned with file APIs.
- Canvas Setup: Canvas Iframe Initialization
- File Management: File Management
- File API: API References
