helloWorldPDF
HTTP (deprecated)
v2
Preview
1
2
3
4
5
6
7
8
9
// View me at https://neverstew-helloWorldPDF.web.val.run
export
const
helloWorldPDF
=
async
(
req
:
Request
)
=>
{
const
{
jsPDF
}
=
await
import
(
"npm:jspdf"
)
;
const
doc
=
new
jsPDF
(
)
;
doc
.
text
(
"Hello world!"
,
10
,
10
)
;
return
new
Response
(
doc
.
output
(
)
,
{
headers
:
{
"Content-Type"
:
"application/pdf"
}
,
}
)
;
}
;
Preview