# Send Generated PDF from mail (WebRequest Sendgrid)

**URL:** <https://community.appfarm.io/t/send-generated-pdf-from-mail-webrequest-sendgrid/1209>\
**Category:** Ask the community\
**Created:** [April 30, 2024, 8:05am UTC](https://community.appfarm.io/t/send-generated-pdf-from-mail-webrequest-sendgrid/1209 "2024-04-30T08:05:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yassine.tebib](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/yassine.tebib/32/74_2.png) [@Yassine.tebib](https://community.appfarm.io/u/Yassine.tebib)\
**Post date:** [April 30, 2024, 8:05am UTC](https://community.appfarm.io/t/send-generated-pdf-from-mail-webrequest-sendgrid/1209/1 "2024-04-30T08:05:06Z")

</div>

Hey Everyone

i was wondering if someone knows how to just generate PDF of my actual page and send it by mail from a webrequest ( not with appfarm built in “Send Email”).

i’m able to generate my PDF, but it only can be saved directly from the browser (i tried with html2pdf for that).

i’m just not finding a way to add it to my email without saving it. ( i’m using sendgrid )

thanks everyone

---

<div class="post-metadata">

**Author:** ![Yassine.tebib](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/yassine.tebib/32/74_2.png) [@Yassine.tebib](https://community.appfarm.io/u/Yassine.tebib)\
**Post date:** [May 21, 2024, 9:13am UTC](https://community.appfarm.io/t/send-generated-pdf-from-mail-webrequest-sendgrid/1209/2 "2024-05-21T09:13:37Z")

</div>

Hey There

just trying to relaunch this discussion. if anybody can help ( even if it’s not in sendgrid) it will be very appriciated.

thanks again

---

<div class="post-metadata">

**Author:** ![oyvind.byhring](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/oyvind.byhring/32/1060_2.png) [@oyvind.byhring](https://community.appfarm.io/u/oyvind.byhring)\
**Post date:** [May 22, 2024, 10:32am UTC](https://community.appfarm.io/t/send-generated-pdf-from-mail-webrequest-sendgrid/1209/3 "2024-05-22T10:32:55Z")

</div>

I haven’t worked with sendgrid before, but in other email API’s the solution for attachments has usually been sending the file encoded as base 64 data as part of the API request.

Is there any way of extracting the pdf as B64 data from html2pdf?

I’m guessing that library creates either B64 or binary data in some part of the process when going from HTML to PDF.

---

<div class="post-metadata">

**Author:** ![Preben](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/preben/32/545_2.png) [@Preben](https://community.appfarm.io/u/Preben)\
**Post date:** [May 8, 2025, 7:45pm UTC](https://community.appfarm.io/t/send-generated-pdf-from-mail-webrequest-sendgrid/1209/4 "2025-05-08T19:45:40Z")

</div>

Hi, did you find a solution to get the base64 string ? I have the same issue 🙂

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [May 9, 2025, 5:33am UTC](https://community.appfarm.io/t/send-generated-pdf-from-mail-webrequest-sendgrid/1209/5 "2025-05-09T05:33:32Z")

</div>

Just for the record: This one (generate base64 string in html2pdf) is solved [here](https://community.appfarm.io/t/generate-pdf-and-save-to-file-object-or-as-base64-string/1836).
