diff --git a/pitfall/pitfall/test/test.pdf b/pitfall/pitfall/test/test.pdf index dcccbd0d..50ed9ca0 100644 Binary files a/pitfall/pitfall/test/test.pdf and b/pitfall/pitfall/test/test.pdf differ diff --git a/pitfall/pitfall/test/test4.pdf b/pitfall/pitfall/test/test4.pdf index f9a6248c..3978bd73 100644 --- a/pitfall/pitfall/test/test4.pdf +++ b/pitfall/pitfall/test/test4.pdf @@ -168,7 +168,7 @@ endobj << /Producer (PDFKit) /Creator (PDFKit) -/CreationDate (D:20170517045710Z) +/CreationDate (D:20170517051245Z) >> endobj 13 0 obj diff --git a/pitfall/pitfall/test/test5.coffee b/pitfall/pitfall/test/test5.coffee new file mode 100644 index 00000000..fc8d97cd --- /dev/null +++ b/pitfall/pitfall/test/test5.coffee @@ -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() \ No newline at end of file diff --git a/pitfall/pitfall/test/test5.pdf b/pitfall/pitfall/test/test5.pdf new file mode 100644 index 00000000..3e222235 Binary files /dev/null and b/pitfall/pitfall/test/test5.pdf differ diff --git a/pitfall/pitfall/test/test5.rkt b/pitfall/pitfall/test/test5.rkt new file mode 100644 index 00000000..a02c4fe4 --- /dev/null +++ b/pitfall/pitfall/test/test5.rkt @@ -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) \ No newline at end of file diff --git a/pitfall/pitfall/test/test5rkt.pdf b/pitfall/pitfall/test/test5rkt.pdf new file mode 100644 index 00000000..e69de29b