import { afterNextRender, Component, inject } from '@angular/core'; import { EpdfDocuments } from '@embedpdf/angular/runtime'; @Component({ selector: 'app-contract', template: ``, }) export class Contract { private readonly documents = inject(EpdfDocuments); constructor() { // Runs in the browser only, after the first render afterNextRender(() => { void this.documents.open({ kind: 'url', url: 'https://www.cloudpdf.com/pdfs/welcome.pdf' }); }); } }