npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pdftron/webviewer-bim-client

v2.0.0

Published

Addon for WebViewer that allows you to view, annotate, and collaborate on 3D models.

Downloads

122

Readme

WebViewer BIM Client

WebViewer is a powerful JavaScript-based library that's part of the PDFTron SDK. It allows you to view and annotate various file formats (PDF, MS Office, images, videos) on your web app with a fully customizable UI.

This sample uses the BIM addon for WebViewer. It allows you to view, annotate, and collaborate on 3D models.

Request a trial license key to try for free.

webviewer-bim-1-0-0

Architecture

There are two components to WebViewer BIM:

  1. Server-side file conversion that supports 3D streaming to the client.
  2. Client-side 3D viewer that renders BIM models and allows navigation entirely encapsulated in our familiar WebViewer UI.

Initial setup

Before you begin, make sure your development environment includes Node.js and npm.

Usage

1. Install WebViewer and WebViewer BIM Client

npm i @pdftron/webviewer --save
npm i @pdftron/webviewer-bim-client --save

This will also download all the assets that need to be included for WebViewer BIM to work.

2. Copy assets to public/ folder

These assets need to be served with your application. For example, if your project is built into a dist folder, you could copy these assets into dist/public.

The two folders you need to copy are:

  • node_modules/@pdftron/webviewer/public
  • node_modules/@pdftron/webviewer-bim/dist
cp -R ./node_modules/@pdftron/webviewer/public public/webviewer/lib
cp -R ./node_modules/@pdftron/webviewer-bim/dist public/webviewer-bim

Afterwards the folder structure will look something like:

public/
  webviewer/
    lib/
      ui/
      core/
  webviewer-bim/
    compress/
    oda/
    webviewer-bim-min.js

We recommend using a module bundler like Webpack to automatically do this for you. There is a nice plugin called copy-webpack-plugin that does just this.

3. Import and instantiate WebViewer and WebViewer BIM Client

import  Webviewer  from  '@pdftron/webviewer';
import { initializeBimViewer, unmountBimViewer } from '@pdftron/webviewer/bim-client'

Webviewer({
  path: '/webviewer/lib',
}, document.getElementById('viewer')).then(instance  => {

  const  license = `---- Insert commercial license key here after purchase ----`;
  const  serverURL = `---- Insert server URL after setup ----`;
  const  options = {
    license: license,

    // dataSchema omitted for clarity.
    // See documentations for details: https://www.pdftron.com/documentation/web/guides/BIM/api/#initializebimviewer
    dataSchema: {}
  };

  const webviewerBim = await initializeBimViewer(instance, serverURL, options);
  webviewerBim.File.load3dAsset('Add URL to your 3D asset here');

  // Call unmountBimViewer when you're ready to unmount.
  // unmountBimViewer(instance);
}

4. Setup WebViewer BIM Server

See Setting up WebViewer BIM Server.

Documentation

https://www.pdftron.com/documentation/web/guides/BIM/

WebViewer BIM APIs

License

WebViewer BIM will run in trial mode until a license is provided. For more information on licensing, please visit our website.