Overview

Here are my notes on how to use the Universal Viewer npm package in Next.js.

Installation

Install with the following command.

npmiuniversalviewer

Implementation

Since it uses useEffect, it appeared necessary to implement it as a client component.

Also, by adding the uv class to the div tag, the CSS was applied correctly.

'iii}f}c}eummnuo)xspptmcxnu}rnsl)peooeavyCcs,eCsso,orrrn?wotecrit<otra<rcttfi:hmiEoen[udm:dd/tlaf?pofnqimripViis}Ldi{dcen:onfIsutanvoifnvt}oideyesunemti(nneagywhdjabavenuntmseVcpr'i(iewl:lieiulad>ftsaV:btnito{eufdnesedissicia'emierte(r(ve=tre=tgptgknuEiesriw(ti''s",{hhlingglfcwtnie)nu,tut={:tafIrtfergmrain,vh=:yytovefripC=nti{"ad>':CeuiVcrPnlo>dvcty1'omneitorgem}emvcn06'nsdwemomp{ira,lda00ft::ew}peon=snaim%vlere'snniaixssi'hen''.rfntetrlfysac,'xtc#.re{anievewNb(,':ef.oxttaqishal(,n0mti(luet]me)'tfo{iiw,)esce0'dnzre==erfrymeerc"S>n'0ena(auSt,'aanu'dnvRPe,cminuiv"rrtifinsaao''cevitssnm,'sev/Itditreenys,srsdlreasmeee.cla/x=nrvvli:{de,ivn{eseidcroxweevwslyewx,ivwre.doehrcxtn('syhlV})sw:yi:'he)'owV}1nei)0re0tCw%hoe'emr,pPcorhlnoeiepiensgnt)ht)t,{:si{'d6e0vh'}}></div>

There may be other available options, but I was able to specify the canvas index to initially load with cv and the display rectangle with xywh.

Summary

I hope this serves as a helpful reference for using Universal Viewer.