function generateCoverLetter(){
const selectedRows: IUnprintedLookupResult[] = this.getSelectedRows()
const doc = DocumentCreator.prototype.create(selectedRows);
Packer.toBlob(doc).then(blob => {
console.log(blob);
saveAs(blob, "CoverLetter_" + this.label2 + ".docx");
);
}
By utilizing the code above, I was able to convert the selected array into a doc file as shown below:
[]
We can successfully generate the cover letter. However, my goal is to enable users to download it directly as a PDF and open it in a new tab when clicking on a button. Any ideas?