start test3

main
Matthew Butterick 7 years ago
parent 8012db585b
commit 7f12b5f533

@ -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()

@ -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

@ -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)
Loading…
Cancel
Save