let demoFiles = []; // init all larvitar.initializeImageLoader(); larvitar.initializeCSTools(); larvitar.store.initialize(); larvitar.store.addViewport("viewer"); function renderPDF() { larvitar.resetLarvitarManager(); larvitar .readFile(demoFiles[0]) .then(image => { larvitar.updateLarvitarManager(image); let manager = larvitar.getLarvitarManager(); let serie = manager["1.2.276.0.7230010.3.1.3.296485376.1.1664404001.305752"]; larvitar.renderDICOMPDF(serie, "viewer", true).then(() => { larvitar.addDefaultTools(); larvitar.setToolActive("Pan"); //sx pan dx zoom }); }) .catch(err => console.log(err)); } async function createFile(fileName, cb) { let response = await fetch("./demo/" + fileName); let data = await response.blob(); let file = new File([data], fileName); demoFiles.push(file); cb(); } createFile("pdf.dcm", renderPDF);