rearrangement servant
parent
69dec279f1
commit
0905b02bfb
@ -1,6 +0,0 @@
|
||||
#lang br
|
||||
(provide (struct-out String))
|
||||
|
||||
;; use structs to sub for missing node types
|
||||
|
||||
(struct String (string) #:transparent)
|
@ -0,0 +1,16 @@
|
||||
#lang racket/base
|
||||
(provide (all-defined-out))
|
||||
|
||||
(struct co-dict (dict) #:transparent)
|
||||
(struct co-array (items) #:transparent)
|
||||
(struct co-stream (dict data) #:transparent)
|
||||
(struct co-version (num) #:transparent)
|
||||
(struct co-header (string) #:transparent)
|
||||
(struct co-string (string) #:transparent)
|
||||
(struct co-io (idx rev thing) #:transparent)
|
||||
(struct co-io-ref (idx rev) #:transparent)
|
||||
(struct co-comment (text) #:transparent)
|
||||
(struct co-trailer (dict) #:transparent)
|
||||
|
||||
(struct co-hash (hash) #:transparent)
|
||||
(struct co-encoding-datum (datum) #:transparent)
|
@ -0,0 +1,63 @@
|
||||
%PDF-1.3
|
||||
%ÿÿÿÿ
|
||||
5 0 obj
|
||||
<<
|
||||
/Parent 1 0 R
|
||||
/Resources 4 0 R
|
||||
/Contents 3 0 R
|
||||
/MediaBox [0 0 612 792]
|
||||
/Type /Page
|
||||
>>
|
||||
endobj
|
||||
4 0 obj
|
||||
<<
|
||||
/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
||||
>>
|
||||
endobj
|
||||
3 0 obj
|
||||
<<
|
||||
/Length 18
|
||||
>>
|
||||
stream
|
||||
1 0 0 -1 0 792 cm
|
||||
|
||||
endstream
|
||||
endobj
|
||||
6 0 obj
|
||||
<<
|
||||
/CreationDate (D:20170514163610Z)
|
||||
/Creator (PitfallKit)
|
||||
/Producer (PitfallKit)
|
||||
>>
|
||||
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 7
|
||||
0000000000 65535 f
|
||||
0000000403 00000 n
|
||||
0000000354 00000 n
|
||||
0000000186 00000 n
|
||||
0000000119 00000 n
|
||||
0000000015 00000 n
|
||||
0000000254 00000 n
|
||||
trailer
|
||||
<<
|
||||
/Info 6 0 R
|
||||
/Root 2 0 R
|
||||
/Size 7
|
||||
>>
|
||||
startxref
|
||||
460
|
||||
%%EOF
|
@ -1,3 +1,3 @@
|
||||
#lang racket/base
|
||||
(provide (all-defined-out))
|
||||
(define current-debug (make-parameter #t))
|
||||
(define test-mode (make-parameter #f))
|
@ -1,16 +1,6 @@
|
||||
#lang racket/base
|
||||
(provide (all-defined-out))
|
||||
#lang br
|
||||
(provide (struct-out String))
|
||||
|
||||
(struct co-dict (dict) #:transparent)
|
||||
(struct co-array (items) #:transparent)
|
||||
(struct co-stream (dict data) #:transparent)
|
||||
(struct co-version (num) #:transparent)
|
||||
(struct co-header (string) #:transparent)
|
||||
(struct co-string (string) #:transparent)
|
||||
(struct co-io (idx rev thing) #:transparent)
|
||||
(struct co-io-ref (idx rev) #:transparent)
|
||||
(struct co-comment (text) #:transparent)
|
||||
(struct co-trailer (dict) #:transparent)
|
||||
;; use structs to sub for missing node types
|
||||
|
||||
(struct co-hash (hash) #:transparent)
|
||||
(struct co-encoding-datum (datum) #:transparent)
|
||||
(struct String (string) #:transparent)
|
@ -0,0 +1,7 @@
|
||||
#lang racket/base
|
||||
(require rackunit pitfall/helper)
|
||||
(provide (all-defined-out))
|
||||
|
||||
(define-syntax-rule (check-exn-equal? expr val)
|
||||
(check-equal? (with-handlers ([exn:pitfall:test? (λ (e) (exn:pitfall:test-data e))])
|
||||
expr) val))
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 340 KiB After Width: | Height: | Size: 340 KiB |
@ -0,0 +1,3 @@
|
||||
#lang racket
|
||||
(require pitfall/test/test0
|
||||
pitfall/test/test1)
|
@ -0,0 +1,14 @@
|
||||
#lang racket
|
||||
(require pitfall/document pitfall/params rackunit)
|
||||
|
||||
(test-mode #t)
|
||||
(check-true
|
||||
(let ()
|
||||
(define doc (new PDFDocument))
|
||||
(send doc pipe (open-output-file "test0rkt.pdf" #:exists 'replace))
|
||||
(send doc end)))
|
||||
|
||||
(require racket/runtime-path)
|
||||
(define-runtime-path this "test0rkt.pdf")
|
||||
(define-runtime-path control "test0rkt copy.pdf")
|
||||
(check-equal? (file->bytes this) (file->bytes control))
|
@ -0,0 +1,27 @@
|
||||
#lang racket
|
||||
|
||||
(require pitfall/document pitfall/helper pitfall/params rackunit)
|
||||
|
||||
(require racket/runtime-path)
|
||||
(define-runtime-path this "test1rkt.pdf")
|
||||
(define-runtime-path control "test1rkt copy.pdf")
|
||||
|
||||
;; Create a new PDFDocument
|
||||
(test-mode #t)
|
||||
(check-true
|
||||
(let ()
|
||||
(define doc (new PDFDocument))
|
||||
(send doc pipe (open-output-file this #:exists 'replace))
|
||||
|
||||
;; Draw a triangle and a circle
|
||||
(send*/fold doc [save]
|
||||
[moveTo 100 150]
|
||||
[lineTo 100 250]
|
||||
[lineTo 200 250]
|
||||
[fill "#FF3300"])
|
||||
|
||||
(send*/fold doc [circle 280 200 50] [fill "#6600FF"])
|
||||
|
||||
(send doc end)))
|
||||
|
||||
(check-equal? (file->bytes this) (file->bytes control))
|
@ -0,0 +1,91 @@
|
||||
%PDF-1.3
|
||||
%ÿÿÿÿ
|
||||
6 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]
|
||||
/Type /Page
|
||||
>>
|
||||
endobj
|
||||
4 0 obj
|
||||
<<
|
||||
/ExtGState <<
|
||||
/Gs1 6 0 R
|
||||
>>
|
||||
/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
||||
>>
|
||||
endobj
|
||||
3 0 obj
|
||||
<<
|
||||
/Length 294
|
||||
>>
|
||||
stream
|
||||
1 0 0 -1 0 792 cm
|
||||
q
|
||||
100 150 m
|
||||
100 250 l
|
||||
200 250 l
|
||||
/DeviceRGB cs
|
||||
1 0.2 0 scn
|
||||
/Gs1 gs
|
||||
f
|
||||
230 200 m
|
||||
230 172.385763 252.385763 150 280 150 c
|
||||
307.614237 150 330 172.385763 330 200 c
|
||||
330 227.614237 307.614237 250 280 250 c
|
||||
252.385763 250 230 227.614237 230 200 c
|
||||
h
|
||||
/DeviceRGB cs
|
||||
0.4 0 1 scn
|
||||
/Gs1 gs
|
||||
f
|
||||
|
||||
endstream
|
||||
endobj
|
||||
7 0 obj
|
||||
<<
|
||||
/CreationDate (D:19700101000000Z)
|
||||
/Creator (PitfallKit)
|
||||
/Producer (PitfallKit)
|
||||
>>
|
||||
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 8
|
||||
0000000000 65535 f
|
||||
0000000752 00000 n
|
||||
0000000703 00000 n
|
||||
0000000258 00000 n
|
||||
0000000163 00000 n
|
||||
0000000059 00000 n
|
||||
0000000015 00000 n
|
||||
0000000603 00000 n
|
||||
trailer
|
||||
<<
|
||||
/Info 7 0 R
|
||||
/Root 2 0 R
|
||||
/Size 8
|
||||
>>
|
||||
startxref
|
||||
809
|
||||
%%EOF
|
@ -0,0 +1,63 @@
|
||||
%PDF-1.3
|
||||
%ÿÿÿÿ
|
||||
5 0 obj
|
||||
<<
|
||||
/Parent 1 0 R
|
||||
/Resources 4 0 R
|
||||
/Contents 3 0 R
|
||||
/MediaBox [0 0 612 792]
|
||||
/Type /Page
|
||||
>>
|
||||
endobj
|
||||
4 0 obj
|
||||
<<
|
||||
/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
||||
>>
|
||||
endobj
|
||||
3 0 obj
|
||||
<<
|
||||
/Length 18
|
||||
>>
|
||||
stream
|
||||
1 0 0 -1 0 792 cm
|
||||
|
||||
endstream
|
||||
endobj
|
||||
6 0 obj
|
||||
<<
|
||||
/CreationDate (D:19700101000000Z)
|
||||
/Creator (PitfallKit)
|
||||
/Producer (PitfallKit)
|
||||
>>
|
||||
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 7
|
||||
0000000000 65535 f
|
||||
0000000403 00000 n
|
||||
0000000354 00000 n
|
||||
0000000186 00000 n
|
||||
0000000119 00000 n
|
||||
0000000015 00000 n
|
||||
0000000254 00000 n
|
||||
trailer
|
||||
<<
|
||||
/Info 6 0 R
|
||||
/Root 2 0 R
|
||||
/Size 7
|
||||
>>
|
||||
startxref
|
||||
460
|
||||
%%EOF
|
@ -0,0 +1,91 @@
|
||||
%PDF-1.3
|
||||
%ÿÿÿÿ
|
||||
6 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]
|
||||
/Type /Page
|
||||
>>
|
||||
endobj
|
||||
4 0 obj
|
||||
<<
|
||||
/ExtGState <<
|
||||
/Gs1 6 0 R
|
||||
>>
|
||||
/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
||||
>>
|
||||
endobj
|
||||
3 0 obj
|
||||
<<
|
||||
/Length 238
|
||||
>>
|
||||
stream
|
||||
1 0 0 -1 0 792 cm
|
||||
q
|
||||
100 150 m
|
||||
100 250 l
|
||||
200 250 l
|
||||
/DeviceRGB cs
|
||||
1 0.2 0 scn
|
||||
/Gs1 gs
|
||||
f
|
||||
230 200 m
|
||||
230 150 230 150 280 150 c
|
||||
330 150 330 150 330 200 c
|
||||
330 250 330 250 280 250 c
|
||||
230 250 230 250 230 200 c
|
||||
h
|
||||
/DeviceRGB cs
|
||||
0.4 0 1 scn
|
||||
/Gs1 gs
|
||||
f
|
||||
|
||||
endstream
|
||||
endobj
|
||||
7 0 obj
|
||||
<<
|
||||
/CreationDate (D:19700101000000Z)
|
||||
/Creator (PitfallKit)
|
||||
/Producer (PitfallKit)
|
||||
>>
|
||||
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 8
|
||||
0000000000 65535 f
|
||||
0000000696 00000 n
|
||||
0000000647 00000 n
|
||||
0000000258 00000 n
|
||||
0000000163 00000 n
|
||||
0000000059 00000 n
|
||||
0000000015 00000 n
|
||||
0000000547 00000 n
|
||||
trailer
|
||||
<<
|
||||
/Info 7 0 R
|
||||
/Root 2 0 R
|
||||
/Size 8
|
||||
>>
|
||||
startxref
|
||||
753
|
||||
%%EOF
|
@ -1,7 +0,0 @@
|
||||
#lang br
|
||||
|
||||
(require pitfall/kit/document)
|
||||
|
||||
(define doc (new PDFDocument))
|
||||
(send doc pipe (open-output-file "test0rkt.pdf" #:exists 'replace))
|
||||
(send doc end)
|
@ -1,18 +0,0 @@
|
||||
#lang br
|
||||
|
||||
(require pitfall/kit/document pitfall/kit/helper)
|
||||
|
||||
;; Create a new PDFDocument
|
||||
(define doc (new PDFDocument))
|
||||
(send doc pipe (open-output-file "test1rkt.pdf" #:exists 'replace))
|
||||
|
||||
;; Draw a triangle and a circle
|
||||
(send*/fold doc [save]
|
||||
[moveTo 100 150]
|
||||
[lineTo 100 250]
|
||||
[lineTo 200 250]
|
||||
[fill "#FF3300"])
|
||||
|
||||
(send*/fold doc [circle 280 200 50] [fill "#6600FF"])
|
||||
|
||||
(send doc end)
|
Loading…
Reference in New Issue