start test12

main
Matthew Butterick 8 years ago
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.

@ -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
xœeŽÁ
Â0 †ïyŠ¼€[“µéâaS]oâeeŠà)èë›ÁAB~Hò%<08>ÆT|Å×Ãë‡c[cL0M S|@Þ&Âkç/Ñt3Ñ5û‰à‰(ð d´Ë6ó2Oßúô ýY×an*«ûâMfƒþ´%, œ–¶çY©|¡JšQ*¤gZ¡9cØÁ&¨Ç<07>'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
Loading…
Cancel
Save