import { Component, AfterViewInit } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { DsPdfViewer } from "@mescius/dspdfviewer";

@Component({
  selector: 'app-root',
  imports: [RouterOutlet],
  templateUrl: './app.component.html',
  styleUrl: './app.component.css'
})
export class AppComponent implements AfterViewInit {
  title = 'pdf-viewer-app';

  ngAfterViewInit() {
  const viewer = new DsPdfViewer("#viewer", {
      workerSrc: "//node_modules/@mescius/dspdfviewer/dspdfviewer.worker.js",
      restoreViewStateOnLoad: false
    });
    viewer.addDefaultPanels();
    viewer.open("assets/pdf/newsletter.pdf");
    //viewer.open('https://developer.mescius.com/document-solutions/dot-net-pdf-api/docs/offlinehelp.pdf');
    //viewer.open("assets/pdf/newsletter.pdf");

  }
}
