I am stuck at one of the issue where I have a anchor tag in a component , on click of It ,I have a post method which is posting some data into service and in response I am getting report data as a html string , Now client wants to see the report as a PDF in a new window . How to achieve this ,there are lots of articles but none of it resolved ,need some simple solution . Somewhere I read to convert html string in service to byte of array using encode and then Create Url Object (front end -Blob) but that is also not working. I dont have the exact code but a kind of replica I just shared ,any help would be great.
<a (click)= "openreport(request)" />
openreport(request) {
this.dataservice.postdata('service url' ,request).subscribe(res= >{
res.creditreportdata---> html string
})
}