From 7f12b5f53394be7e9618d2d8b5f7611e6ce49eef Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 15 May 2017 15:29:12 -0700 Subject: [PATCH] start test3 --- pitfall/pitfall/test/test3.coffee | 10 ++++ pitfall/pitfall/test/test3.pdf | 83 +++++++++++++++++++++++++++++++ pitfall/pitfall/test/test3.rkt | 10 ++++ pitfall/pitfall/test/test3rkt.pdf | 0 4 files changed, 103 insertions(+) create mode 100644 pitfall/pitfall/test/test3.coffee create mode 100644 pitfall/pitfall/test/test3.pdf create mode 100644 pitfall/pitfall/test/test3.rkt create mode 100644 pitfall/pitfall/test/test3rkt.pdf diff --git a/pitfall/pitfall/test/test3.coffee b/pitfall/pitfall/test/test3.coffee new file mode 100644 index 00000000..83430697 --- /dev/null +++ b/pitfall/pitfall/test/test3.coffee @@ -0,0 +1,10 @@ +PDFDocument = require 'pdfkit' +fs = require 'fs' + +# Create a new PDFDocument +doc = new PDFDocument({compress: no}) +doc.pipe(fs.createWriteStream('test3.pdf')) + +doc.text("Hello world") + +doc.end() \ No newline at end of file diff --git a/pitfall/pitfall/test/test3.pdf b/pitfall/pitfall/test/test3.pdf new file mode 100644 index 00000000..8bc82f62 --- /dev/null +++ b/pitfall/pitfall/test/test3.pdf @@ -0,0 +1,83 @@ +%PDF-1.3 +%ÿÿÿÿ +5 0 obj +<< +/Type /Page +/Parent 1 0 R +/MediaBox [0 0 612 792] +/Contents 3 0 R +/Resources 4 0 R +>> +endobj +4 0 obj +<< +/ProcSet [/PDF /Text /ImageB /ImageC /ImageI] +/Font << +/F1 6 0 R +>> +>> +endobj +3 0 obj +<< +/Length 123 +>> +stream +1 0 0 -1 0 792 cm +q +1 0 0 -1 0 792 cm +BT +1 0 0 1 72 711.384 Tm +/F1 12 Tf +[<48656c6c6f2077> 10 <6f72> -15 <6c64> 0] TJ +ET +Q + +endstream +endobj +7 0 obj +<< +/Producer (PDFKit) +/Creator (PDFKit) +/CreationDate (D:20170515222812Z) +>> +endobj +6 0 obj +<< +/Type /Font +/BaseFont /Helvetica +/Subtype /Type1 +/Encoding /WinAnsiEncoding +>> +endobj +2 0 obj +<< +/Type /Catalog +/Pages 1 0 R +>> +endobj +1 0 obj +<< +/Type /Pages +/Count 1 +/Kids [5 0 R] +>> +endobj +xref +0 8 +0000000000 65535 f +0000000620 00000 n +0000000571 00000 n +0000000208 00000 n +0000000119 00000 n +0000000015 00000 n +0000000474 00000 n +0000000382 00000 n +trailer +<< +/Size 8 +/Root 2 0 R +/Info 7 0 R +>> +startxref +677 +%%EOF diff --git a/pitfall/pitfall/test/test3.rkt b/pitfall/pitfall/test/test3.rkt new file mode 100644 index 00000000..9d999c64 --- /dev/null +++ b/pitfall/pitfall/test/test3.rkt @@ -0,0 +1,10 @@ +#lang pitfall/pdftest +(define-runtime-path this "test3rkt.pdf") + +(check-true + (let ([doc (new PDFDocument)]) + (send doc pipe (open-output-file this #:exists 'replace)) + (send doc text "Hello world") + (send doc end))) + +(check-copy-equal? this) \ No newline at end of file diff --git a/pitfall/pitfall/test/test3rkt.pdf b/pitfall/pitfall/test/test3rkt.pdf new file mode 100644 index 00000000..e69de29b