main
Matthew Butterick 8 years ago
parent 273a840a89
commit 9eee8f36eb

@ -10,4 +10,5 @@
pitfall/test/test2c
pitfall/test/test3c
pitfall/test/test4c
pitfall/page-test))
pitfall/page-test
(submod pitfall/zlib test)))

@ -2,19 +2,11 @@
(require "object.rkt" "zlib.rkt")
(provide PDFReference)
#|
(when (· this deflate)
(define compressed-chunks (map deflate (· this chunks)))
(set-field! chunks this compressed-chunks)
(hash-set! (· this data) 'Length (apply + (map bytes-length compressed-chunks))))
|#
(define-subclass object% (PDFReference document id [data (mhash)])
(super-new)
(field [gen 0]
[i-wanna-be-deflated #f]
[compress (and (· document compress)
(not (hash-ref data 'Filter #f)))]
[compress (and (· document compress) (not (hash-ref data 'Filter #f)))]
[chunks empty]
[offset #f])
@ -29,6 +21,7 @@
(any/c . ->m . void?)
(send this _write data #f void))
(define/contract (_write this chunk-in encoding callback)
((or/c string? isBuffer?) (or/c string? #f) procedure? . ->m . any/c)
(define chunk (if (isBuffer? chunk-in)

Loading…
Cancel
Save