NPM Examples
Runnable Rasterex Viewer examples for common NPM integration patterns.
Start with Rasterex Viewer Examples to use a runnable NPM integration instead of assembling a project from individual snippets.
The examples are maintained as runnable applications and are useful when you want to compare setup, viewer initialization, file loading, event handling, and component workflows in context.
- Start with the example closest to your framework and then copy only the viewer setup and workflow code that applies to your application.
- Use the component documentation in this site for the detailed API contract behind each example workflow.
Most NPM examples follow the same high-level setup: install the viewer package, create a viewer container, initialize the viewer from client-side code, open a file, and subscribe to events needed by your UI.
Use the examples when you need a complete reference for project wiring, lifecycle handling, and practical UI flows.
- New application setup: copy the project structure and viewer initialization pattern.
- Framework integration: compare how the viewer is mounted and cleaned up in the selected framework.
- Feature workflows: review working file, annotation, measurement, calibration, PDF, CAD, and collaboration flows.
- Troubleshooting: compare your setup against a known working application.
Compare drawing revisions
Compare two drawing revisions in a web application.
Compare PDF and DWG versions
Compare PDF or DWG versions with direct comparison or alignment.
Embed comparison in an ERP
Embed drawing comparison in an ERP or asset-management page.
Measure and take off quantities
Set scale, measure quantities, and retrieve takeoff data in the browser.
Save and reload markups
Associate markups with an immutable file version and host record.
Start with the problem you are trying to solve. Each solution page explains the verified workflow, links to the relevant component references, and keeps NPM SDK guidance separate from the PostMessage variant.
The workflow source is maintained in Rasterex workflow examples. The current repository provides source links for the reference applications; live-demo and StackBlitz URLs are listed only after those deployments exist.
Use the source README and application code to inspect the host UI sequence. These examples use the PostMessage workflow repository, so use the solution page and the NPM component references when implementing the NPM SDK contract.
