How to download pdf file in angular 2
In Angular 6, In service downloadPdfFile.service.ts and create the following things. Import Statement import { HttpClient, HttpHeaders } from ‘@angular/common/http’; import { map } from ‘rxjs/operators’; Method for download pdf downloadPDF(dataObj) { let headerOptions = new HttpHeaders({ ‘Content-Type’: ‘application/json’, ‘Accept’: ‘application/pdf’ // ‘Accept’: ‘application/octet-stream’, // for excel file }); let requestOptions = { headers: headerOptions, … Read more