diff --git a/pitfall/pitfall/test/test12.coffee b/pitfall/pitfall/test/test12.coffee new file mode 100644 index 00000000..e246ed8f --- /dev/null +++ b/pitfall/pitfall/test/test12.coffee @@ -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 diff --git a/pitfall/pitfall/test/test12.pdf b/pitfall/pitfall/test/test12.pdf new file mode 100644 index 00000000..e024bfc9 Binary files /dev/null and b/pitfall/pitfall/test/test12.pdf differ diff --git a/pitfall/pitfall/test/test12.rkt b/pitfall/pitfall/test/test12.rkt new file mode 100644 index 00000000..c4e65852 --- /dev/null +++ b/pitfall/pitfall/test/test12.rkt @@ -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) diff --git a/pitfall/pitfall/test/test12c.pdf b/pitfall/pitfall/test/test12c.pdf new file mode 100644 index 00000000..cb88d61b Binary files /dev/null and b/pitfall/pitfall/test/test12c.pdf differ diff --git a/pitfall/pitfall/test/test12crkt.pdf b/pitfall/pitfall/test/test12crkt.pdf new file mode 100644 index 00000000..a26229c2 --- /dev/null +++ b/pitfall/pitfall/test/test12crkt.pdf @@ -0,0 +1,112 @@ +%PDF-1.3 +% +6 0 obj +<< +/ca 1 +/Type /ExtGState +>> +endobj +7 0 obj +<< +/URI (http://google.com/) +/S /URI +>> +endobj +8 0 obj +<< +/A 7 0 R +/Border [0 0 0] +/Subtype /Link +/Rect [100 664.25 281.71 692] +/Type /Annot +>> +endobj +9 0 obj +<< +/CA 1 +/Type /ExtGState +>> +endobj +5 0 obj +<< +/Parent 1 0 R +/Resources 4 0 R +/Contents 3 0 R +/MediaBox [0 0 612 792] +/Annots [8 0 R] +/Type /Page +>> +endobj +4 0 obj +<< +/Font << +/F1 10 0 R +>> +/ExtGState << +/Gs2 9 0 R +/Gs1 6 0 R +>> +/ProcSet [/PDF /Text /ImageB /ImageC /ImageI] +>> +endobj +3 0 obj +<< +/Length 161 +/Filter /FlateDecode +>> +stream +xe +0 y[aS]oee)AB~H%ƂT|Gc[cL0M S|@&k/t35( d6G2O Yan*Mf%, Y|JQ*gZ9c&'0P +endstream +endobj +11 0 obj +<< +/CreationDate (D:19700101000000Z) +/Creator (PITKIT) +/Producer (PITKIT) +>> +endobj +10 0 obj +<< +/BaseFont /Helvetica +/Encoding /WinAnsiEncoding +/Subtype /Type1 +/Type /Font +>> +endobj +2 0 obj +<< +/Pages 1 0 R +/Type /Catalog +>> +endobj +1 0 obj +<< +/Kids [5 0 R] +/Count 1 +/Type /Pages +>> +endobj +xref +0 12 +0000000000 65535 f +0000000984 00000 n +0000000935 00000 n +0000000511 00000 n +0000000382 00000 n +0000000262 00000 n +0000000015 00000 n +0000000059 00000 n +0000000114 00000 n +0000000218 00000 n +0000000837 00000 n +0000000744 00000 n +trailer +<< +/Info 11 0 R +/Root 2 0 R +/Size 12 +>> +startxref +1041 +%%EOF diff --git a/pitfall/pitfall/test/test12rkt.pdf b/pitfall/pitfall/test/test12rkt.pdf new file mode 100644 index 00000000..e69de29b