You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
406 B
CoffeeScript
21 lines
406 B
CoffeeScript
7 years ago
|
PDFDocument = require 'pdfkit'
|
||
|
fs = require 'fs'
|
||
|
|
||
|
make = (doc) ->
|
||
|
|
||
|
# Register a font name for use later
|
||
|
doc.registerFont('the-font', 'assets/fira.ttf')
|
||
|
|
||
|
# Set the font, draw some text
|
||
|
doc.font('the-font')
|
||
|
.fontSize(25)
|
||
7 years ago
|
.text('HTAVATH', 100, 100, {width: false})
|
||
7 years ago
|
|
||
|
doc.end()
|
||
|
|
||
|
|
||
|
doc = new PDFDocument({compress: no})
|
||
|
doc.pipe(fs.createWriteStream('test15.pdf'))
|
||
|
make doc
|
||
|
|