# Doubt on pdf download

**URL:** https://community.neutrinos.com/t/doubt-on-pdf-download/1173
**Category:** Training, Academy & Certifications
**Created:** [September 2, 2025, 10:05am UTC](https://community.neutrinos.com/t/doubt-on-pdf-download/1173 "2025-09-02T10:05:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![navaneethck\_10](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/n/6bbea6/32.png) [@navaneethck\_10](https://community.neutrinos.com/u/navaneethck_10)
#### Post date: [September 2, 2025, 10:05am UTC](https://community.neutrinos.com/t/doubt-on-pdf-download/1173/1 "2025-09-02T10:05:15Z")

</div>

async function generateAuditPDF(filteredAudits) {  
const htmlContent = generateHTML(filteredAudits);  
const puppeteer = require(“puppeteer”);  
const browser = await puppeteer.launch();  
const page = await browser.newPage();  
await page.setContent(htmlContent);  
const pdfBuffer = await page.pdf({  
format: “A4”,  
printBackground: true  
});  
await browser.close();  
return pdfBuffer;  
}  
const pdfBuffer = await generateAuditPDF(bh.input.findResult);  
bh.local.pdf=pdfBuffer  
return bh;

how to do pdf download properly , now iam setting pdfBuffer into bh.local.pdf ,how i process the downloading

---

<div class="post-metadata">

### Author: ![Sam](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/s/5f9b8f/32.png) [@Sam](https://community.neutrinos.com/u/Sam)
#### Post date: [September 2, 2025, 10:15am UTC](https://community.neutrinos.com/t/doubt-on-pdf-download/1173/2 "2025-09-02T10:15:57Z")

</div>

Hello @navaneethck_10 , If you have the buffer, you can pass it to the frontend and convert it into a Blob.

example  
// Suppose `pdfBuffer` is your buffer (ArrayBuffer or Uint8Array)  
const downloadPDF = (pdfBuffer) =\> {  
// Convert buffer to Blob  
const blob = new Blob([pdfBuffer], { type: “application/pdf” });

// Create a download link  
const url = window.URL.createObjectURL(blob);  
const a = document.createElement(“a”);  
a.href = url;  
a.download = “document.pdf”; // file name  
document.body.appendChild(a);  
a.click();

// Cleanup  
a.remove();  
window.URL.revokeObjectURL(url);  
};

---

<div class="post-metadata">

### Author: ![navaneethck\_10](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/n/6bbea6/32.png) [@navaneethck\_10](https://community.neutrinos.com/u/navaneethck_10)
#### Post date: [September 2, 2025, 10:24am UTC](https://community.neutrinos.com/t/doubt-on-pdf-download/1173/3 "2025-09-02T10:24:38Z")

</div>

i wanna know how to send the buffer properly in http out? now when i send buffer from backend then ends with errors in postman

---

<div class="post-metadata">

### Author: ![JeevanKumar](https://community.neutrinos.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@JeevanKumar](https://community.neutrinos.com/u/JeevanKumar)
#### Post date: [September 11, 2025, 6:52am UTC](https://community.neutrinos.com/t/doubt-on-pdf-download/1173/4 "2025-09-11T06:52:22Z")

</div>

Hi @Sam  
Need solution for this ,

How to send pdf buffer in http out node.

 ![Screenshot 2025-09-11 at 12.19.02 PM](https://community.neutrinos.com/uploads/default/original/2X/9/93239cb549ae9f29be0e64176b1bc80b92d6c1f6.png)

Now not receiving any response.

```auto
curl -X GET http://localhost:8081/api/audits/report/pdf\?startTime\=2025-09-03T19:36:08.022Z\&endTime\=2025-09-10T12:05:34.638Z\&operation\=CREATE_BOOK \
  -H "Origin: http://localhost:4200" \
  -H "Access-Control-Allow-Origin: http://localhost:4200" \
  -o document.pdf \
-i
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- 0:00:44 --:--:-- 0

```

the response not ending.
