Skip to content

Instantly share code, notes, and snippets.

View codehippie1's full-sized avatar
🎯
Focusing

Aneesh Lal Gopalakrishnan codehippie1

🎯
Focusing
View GitHub Profile
@codehippie1
codehippie1 / How to add pdf.js and viewer.html to angular 2 application.(With Optional aspnet core|webapi|mvc backend report generation using MS Local RDLC report viewer).md
Last active July 1, 2022 09:31
How to add pdf.js and viewer.html to angular 2 application.(With Optional aspnet core/webapi/mvc backend report generation using MS Local RDLC report viewer)

How to add pdf.js and viewer.html to angular 2 application.(With Optional aspnet core/webapi/mvc backend report generation using MS Local RDLC report viewer)

  1. copy the 'web' and 'build' folders from https://github.com/mozilla/pdfjs-dist under your application's assets folder.
  2. Get/Create your `Blob() object
this.http.get(url, { responseType: ResponseContentType.Blob }).map(
(res) => {
  return new Blob([res.blob()], { type: fileType });
});
  1. Create url using blob and supply to viewer.html