start test5

main
Matthew Butterick 8 years ago
parent febd77723e
commit 70b121ce12

Binary file not shown.

@ -168,7 +168,7 @@ endobj
<<
/Producer (PDFKit)
/Creator (PDFKit)
/CreationDate (D:20170517045710Z)
/CreationDate (D:20170517051245Z)
>>
endobj
13 0 obj

@ -0,0 +1,16 @@
PDFDocument = require 'pdfkit'
tiger = require './assets/tiger'
fs = require 'fs'
# Create a new PDFDocument
doc = new PDFDocument
doc.pipe fs.createWriteStream('test5.pdf')
# Set the font, draw some text, and embed an image
doc.font('Times-Italic')
.fontSize(25)
.text('Some text with an embedded font!', 100, 100, lineBreak: no)
.image('assets/test.png', 100, 160, width: 412)
.image('assets/test.jpeg', 190, 400, height: 300)
doc.end()

Binary file not shown.

@ -0,0 +1,20 @@
#lang pitfall/pdftest
(define-runtime-path this "test5rkt.pdf")
(check-true
(let ([doc (new PDFDocument)])
(send doc pipe (open-output-file this #:exists 'replace))
;; # Set the font, draw some text, and embed an image
(send* doc
[font "Times-Italic"]
[fontSize 25]
[text "Some text with an embedded font!" 100 100 (hash 'lineBreak #f)]
[image "assets/test.png" 100 160 (hash 'width 412)]
[image "assets/test.jpeg" 190 400 (hash 'height 300)]
)
(send doc end)))
;(check-copy-equal? this)
Loading…
Cancel
Save