style body min height 900px style iframe width 95 height 800px iframe script src https github com devongovett pdfkit releases download v0 10 0 pdfkit standalone js script script src https github com devongovett blob stream releases download v0 1 3 blob stream js script script async var doc new PDFDocument size 5 72 8 72 72 per inch margins top 10 left 10 right 10 bottom 10 var stream doc pipe blobStream doc text text x y height doc page height doc text 20 10 20 doc text 50 10 50 doc text 80 10 80 doc text 110 10 110 doc text 131 10 131 doc rect 200 20 90 90 fillAndStroke orange black let text Some text with standard font doc fontSize 5 fillColor black text text repeat 50 width 200 10 const logop await fetch https notebook xbdev net var images test512 png const logo await logop arrayBuffer doc opacity 0 2 image logo 10 200 width 150 height 150 doc opacity 1 0 image logo 200 400 width 50 height 50 doc fontSize 8 opacity 1 0 font Helvetica lineGap 2 text text repeat 200 align justify 0 0 align left get a blob when you re done doc end var blob stream on finish function get a blob you can do whatever you like with blob stream toBlob application pdf or get a blob URL for display in the browser const url stream toBlobURL application pdf const iframe document querySelector iframe iframe src url console log ready script
repeat 50 width 200 10 const logop await fetch https notebook xbdev net var images test512 png const logo await logop arrayBuffer doc opacity 0 2 image logo 10 200 width 150 height 150 doc opacity 1 0 image logo 200 400 width 50 height 50 doc fontSize 8 opacity 1 0 font Helvetica lineGap 2 text text repeat 200 align justify 0 0 align left get a blob when you re done doc end var blob stream on finish function get a blob you can do whatever you like with blob stream toBlob application pdf or get a blob URL for display in the browser const url stream toBlobURL application pdf const iframe document querySelector iframe iframe src url console log ready script