start test12
parent
6c17303056
commit
7189dae52e
@ -0,0 +1,23 @@
|
||||
PDFDocument = require 'pdfkit'
|
||||
fs = require 'fs'
|
||||
|
||||
make = (doc) ->
|
||||
|
||||
# Register a font name for use later
|
||||
doc.registerFont('Charter', 'assets/charter.ttf')
|
||||
|
||||
# Set the font, draw some text
|
||||
doc.font('Charter')
|
||||
.fontSize(25)
|
||||
.text('Some text with an embedded font', 100, 100, {width: false})
|
||||
|
||||
doc.end()
|
||||
|
||||
|
||||
doc = new PDFDocument({compress: no})
|
||||
doc.pipe(fs.createWriteStream('test12.pdf'))
|
||||
make doc
|
||||
|
||||
doc = new PDFDocument({compress: yes})
|
||||
doc.pipe(fs.createWriteStream('test12c.pdf'))
|
||||
make doc
|
Binary file not shown.
@ -0,0 +1,15 @@
|
||||
#lang pitfall/pdftest
|
||||
|
||||
(define (proc doc)
|
||||
(send* doc
|
||||
[fillColor "blue"]
|
||||
[font "Helvetica" 30]
|
||||
[text "Here is a link!" 100 100 (hash
|
||||
'link "http://google.com/"
|
||||
'underline #t)]))
|
||||
|
||||
(define-runtime-path this "test11rkt.pdf")
|
||||
(make-doc this #f proc #:pdfkit #f)
|
||||
|
||||
(define-runtime-path that "test11crkt.pdf")
|
||||
(make-doc that #t proc)
|
Binary file not shown.
Loading…
Reference in New Issue