adjust tests

main
Matthew Butterick 8 years ago
parent fb613bb70e
commit 7cffe2c5b7

@ -5,4 +5,9 @@
pitfall/test/test2
pitfall/test/test3
pitfall/test/test4
pitfall/test/test0c
pitfall/test/test1c
pitfall/test/test2c
pitfall/test/test3c
pitfall/test/test4c
pitfall/page-test))

@ -27,8 +27,8 @@
[x 0]
[y 0]
[info (mhash
'Producer "PitfallKit"
'Creator "PitfallKit"
'Producer "PITKIT"
'Creator "PITKIT"
'CreationDate (seconds->date (if (test-mode)
0
(current-seconds)) #f))] ; Initialize the metadata

@ -38,6 +38,7 @@
(define/contract (_write this chunk-in encoding callback)
(any/c (or/c string? #f) procedure? . ->m . any/c)
#;(report* '_write (· this id) chunk-in)
(define chunk (if (isBuffer? chunk-in)
chunk-in
(newBuffer (string-append chunk-in "\n"))))

@ -26,8 +26,8 @@ endobj
6 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
2 0 obj
@ -46,8 +46,8 @@ endobj
xref
0 7
0000000000 65535 f
0000000403 00000 n
0000000354 00000 n
0000000395 00000 n
0000000346 00000 n
0000000186 00000 n
0000000119 00000 n
0000000015 00000 n
@ -59,5 +59,5 @@ trailer
/Size 7
>>
startxref
460
452
%%EOF

@ -26,8 +26,8 @@ endobj
6 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
2 0 obj
@ -46,8 +46,8 @@ endobj
xref
0 7
0000000000 65535 f
0000000403 00000 n
0000000354 00000 n
0000000395 00000 n
0000000346 00000 n
0000000186 00000 n
0000000119 00000 n
0000000015 00000 n
@ -59,5 +59,5 @@ trailer
/Size 7
>>
startxref
460
452
%%EOF

@ -38,8 +38,8 @@ endobj
7 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
2 0 obj
@ -58,8 +58,8 @@ endobj
xref
0 8
0000000000 65535 f
0000000630 00000 n
0000000581 00000 n
0000000622 00000 n
0000000573 00000 n
0000000258 00000 n
0000000163 00000 n
0000000059 00000 n
@ -72,5 +72,5 @@ trailer
/Size 8
>>
startxref
687
679
%%EOF

@ -38,8 +38,8 @@ endobj
7 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
2 0 obj
@ -58,8 +58,8 @@ endobj
xref
0 8
0000000000 65535 f
0000000630 00000 n
0000000581 00000 n
0000000622 00000 n
0000000573 00000 n
0000000258 00000 n
0000000163 00000 n
0000000059 00000 n
@ -72,5 +72,5 @@ trailer
/Size 8
>>
startxref
687
679
%%EOF

@ -53,8 +53,8 @@ endobj
7 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
2 0 obj
@ -73,8 +73,8 @@ endobj
xref
0 8
0000000000 65535 f
0000000752 00000 n
0000000703 00000 n
0000000744 00000 n
0000000695 00000 n
0000000258 00000 n
0000000163 00000 n
0000000059 00000 n
@ -87,5 +87,5 @@ trailer
/Size 8
>>
startxref
809
801
%%EOF

@ -53,8 +53,8 @@ endobj
7 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
2 0 obj
@ -73,8 +73,8 @@ endobj
xref
0 8
0000000000 65535 f
0000000752 00000 n
0000000703 00000 n
0000000744 00000 n
0000000695 00000 n
0000000258 00000 n
0000000163 00000 n
0000000059 00000 n
@ -87,5 +87,5 @@ trailer
/Size 8
>>
startxref
809
801
%%EOF

@ -0,0 +1,66 @@
PDFDocument = require 'pdfkit'
fs = require 'fs'
# Create a new PDFDocument
doc = new PDFDocument({compress: yes})
doc.pipe(fs.createWriteStream('test2c.pdf'))
doc.moveTo(0, 20)
.lineTo(100, 160)
.quadraticCurveTo(130, 200, 150, 120)
.bezierCurveTo(190, -40, 200, 200, 300, 150) # draw a bezier curve
.lineTo(400, 90) # draw another line
.stroke() # stroke the path
doc.translate(0, 200)
doc.polygon [100, 0], [50, 100], [150, 100]
doc.stroke()
doc.save()
doc.translate(200, 0)
doc.circle(100, 50, 50)
.dash(5, space: 10)
.stroke()
doc.restore()
doc.save()
doc.translate(400, 0)
doc.circle(100, 50, 50)
.lineWidth(3)
.fillOpacity(0.8)
.fillAndStroke("red", "#900")
doc.restore()
doc.translate(0, 200)
# these examples are easier to see with a large line width
doc.lineWidth(25)
# line cap settings
doc.lineCap('butt')
.moveTo(50, 20)
.lineTo(100, 20)
.stroke()
doc.lineCap('round')
.moveTo(150, 20)
.lineTo(200, 20)
.stroke()
# square line cap shown with a circle instead of a line so you can see it
doc.lineCap('square')
.moveTo(250, 20)
.circle(275, 30, 15)
.stroke()
# line join settings
doc.lineJoin('miter')
.rect(50, 100, 50, 50)
.stroke()
doc.lineJoin('round')
.rect(150, 100, 50, 50)
.stroke()
doc.lineJoin('bevel')
.rect(250, 100, 50, 50)
.stroke()
doc.end()

Binary file not shown.

@ -118,8 +118,8 @@ endobj
9 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
2 0 obj
@ -138,8 +138,8 @@ endobj
xref
0 10
0000000000 65535 f
0000001460 00000 n
0000001411 00000 n
0000001452 00000 n
0000001403 00000 n
0000000370 00000 n
0000000253 00000 n
0000000149 00000 n
@ -154,5 +154,5 @@ trailer
/Size 10
>>
startxref
1517
1509
%%EOF

@ -118,8 +118,8 @@ endobj
9 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
2 0 obj
@ -138,8 +138,8 @@ endobj
xref
0 10
0000000000 65535 f
0000001460 00000 n
0000001411 00000 n
0000001452 00000 n
0000001403 00000 n
0000000370 00000 n
0000000253 00000 n
0000000149 00000 n
@ -154,5 +154,5 @@ trailer
/Size 10
>>
startxref
1517
1509
%%EOF

@ -0,0 +1,10 @@
PDFDocument = require 'pdfkit'
fs = require 'fs'
# Create a new PDFDocument
doc = new PDFDocument({compress: yes})
doc.pipe(fs.createWriteStream('test3c.pdf'))
doc.text("Hello world")
doc.end()

Binary file not shown.

@ -37,8 +37,8 @@ endobj
7 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
6 0 obj
@ -65,12 +65,12 @@ endobj
xref
0 8
0000000000 65535 f
0000000628 00000 n
0000000579 00000 n
0000000620 00000 n
0000000571 00000 n
0000000208 00000 n
0000000119 00000 n
0000000015 00000 n
0000000482 00000 n
0000000474 00000 n
0000000382 00000 n
trailer
<<
@ -79,5 +79,5 @@ trailer
/Size 8
>>
startxref
685
677
%%EOF

@ -37,8 +37,8 @@ endobj
7 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
6 0 obj
@ -65,12 +65,12 @@ endobj
xref
0 8
0000000000 65535 f
0000000628 00000 n
0000000579 00000 n
0000000620 00000 n
0000000571 00000 n
0000000208 00000 n
0000000119 00000 n
0000000015 00000 n
0000000482 00000 n
0000000474 00000 n
0000000382 00000 n
trailer
<<
@ -79,5 +79,5 @@ trailer
/Size 8
>>
startxref
685
677
%%EOF

@ -0,0 +1,65 @@
PDFDocument = require 'pdfkit'
fs = require 'fs'
# Create a new PDFDocument
doc = new PDFDocument({compress: yes})
doc.pipe(fs.createWriteStream('test4c.pdf'))
doc.font("Courier-Bold")
.fontSize(10)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Courier-BoldOblique")
.fontSize(11)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Courier-Oblique")
.fontSize(12)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Courier")
.fontSize(14)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Helvetica-Bold")
.fontSize(16)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Helvetica-BoldOblique")
.fontSize(18)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Helvetica-Oblique")
.fontSize(20)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Helvetica")
.fontSize(22)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Symbol")
.fontSize(24)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Times-Bold")
.fontSize(26)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Times-BoldItalic")
.fontSize(28)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Times-Italic")
.fontSize(30)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("Times-Roman")
.fontSize(32)
.text("Hello", lineBreak: no)
.translate(-30,30)
.font("ZapfDingbats")
.fontSize(34)
.text("Hello", lineBreak: no)
doc.end()

Binary file not shown.

@ -167,8 +167,8 @@ endobj
20 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
19 0 obj
@ -299,25 +299,25 @@ endobj
xref
0 21
0000000000 65535 f
0000003390 00000 n
0000003341 00000 n
0000003382 00000 n
0000003333 00000 n
0000000353 00000 n
0000000119 00000 n
0000000015 00000 n
0000002125 00000 n
0000002715 00000 n
0000002225 00000 n
0000002620 00000 n
0000003023 00000 n
0000003126 00000 n
0000002019 00000 n
0000002522 00000 n
0000002427 00000 n
0000002328 00000 n
0000003236 00000 n
0000002922 00000 n
0000002822 00000 n
0000001918 00000 n
0000002117 00000 n
0000002707 00000 n
0000002217 00000 n
0000002612 00000 n
0000003015 00000 n
0000003118 00000 n
0000002011 00000 n
0000002514 00000 n
0000002419 00000 n
0000002320 00000 n
0000003228 00000 n
0000002914 00000 n
0000002814 00000 n
0000001910 00000 n
0000001817 00000 n
trailer
<<
@ -326,5 +326,5 @@ trailer
/Size 21
>>
startxref
3447
3439
%%EOF

@ -167,8 +167,8 @@ endobj
20 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PitfallKit)
/Producer (PitfallKit)
/Creator (PITKIT)
/Producer (PITKIT)
>>
endobj
19 0 obj
@ -299,25 +299,25 @@ endobj
xref
0 21
0000000000 65535 f
0000003390 00000 n
0000003341 00000 n
0000003382 00000 n
0000003333 00000 n
0000000353 00000 n
0000000119 00000 n
0000000015 00000 n
0000002125 00000 n
0000002715 00000 n
0000002225 00000 n
0000002620 00000 n
0000003023 00000 n
0000003126 00000 n
0000002019 00000 n
0000002522 00000 n
0000002427 00000 n
0000002328 00000 n
0000003236 00000 n
0000002922 00000 n
0000002822 00000 n
0000001918 00000 n
0000002117 00000 n
0000002707 00000 n
0000002217 00000 n
0000002612 00000 n
0000003015 00000 n
0000003118 00000 n
0000002011 00000 n
0000002514 00000 n
0000002419 00000 n
0000002320 00000 n
0000003228 00000 n
0000002914 00000 n
0000002814 00000 n
0000001910 00000 n
0000001817 00000 n
trailer
<<
@ -326,5 +326,5 @@ trailer
/Size 21
>>
startxref
3447
3439
%%EOF

Loading…
Cancel
Save