jsPDFExample
HTTP
v1
Preview
1
2
3
4
5
6
7
8
9
import
{
jsPDF
}
from
"npm:jspdf"
;
export
const
helloWorldPDF
=
async
(
req
:
Request
)
=>
{
const
doc
=
new
jsPDF
(
)
;
doc
.
text
(
"Hello world!"
,
10
,
10
)
;
return
new
Response
(
doc
.
output
(
)
,
{
headers
:
{
"Content-Type"
:
"application/pdf"
}
,
}
)
;
}
;
Browser preview