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.
19 lines
508 B
CoffeeScript
19 lines
508 B
CoffeeScript
8 years ago
|
PDFDocument = require 'pdfkit'
|
||
|
fs = require 'fs'
|
||
|
|
||
|
make = (doc) ->
|
||
|
# Add some text with annotations
|
||
|
doc.fillColor("blue")
|
||
7 years ago
|
.translate(50,50)
|
||
8 years ago
|
.font('Helvetica', 30)
|
||
8 years ago
|
.text('Here is a link!', 100, 100, { link: 'http://google.com/', underline: true, width: false})
|
||
8 years ago
|
|
||
|
doc.end()
|
||
|
|
||
7 years ago
|
doc = new PDFDocument({compress: no})
|
||
|
doc.pipe(fs.createWriteStream('test11.pdf'))
|
||
|
make doc
|
||
|
|
||
8 years ago
|
doc = new PDFDocument({compress: yes})
|
||
|
doc.pipe(fs.createWriteStream('test11c.pdf'))
|
||
|
make doc
|