main
Matthew Butterick 6 years ago
parent fd34ea3c00
commit fbe1525f3c

@ -71,9 +71,14 @@
(define stream-length
(read (open-input-bytes (cdr (assoc #"/Length" dic)))))
(define stream (read-bytes stream-length ip))
(append dic (list (cons 'stream (if #R (dict-ref dic '/FlateDecode #f)
(define compressed? (equal? (dict-ref dic #"/Filter" #f) #"/FlateDecode"))
(dict-update
(append dic
(list (cons 'stream (if compressed?
(zlib:inflate stream)
stream))))]
stream))))
;; compressed length may vary, so just set to #"0"
#"/Length" (λ (val) (if compressed? #"0" val)))]
[else dic])]
[else
(pat-lex ip

@ -24,5 +24,5 @@
(define-runtime-path this "test10rkt.pdf")
(make-doc this #f proc)
#;(define-runtime-path that "test10crkt.pdf")
#;(make-doc that #t proc)
(define-runtime-path that "test10crkt.pdf")
(make-doc that #t proc)

Loading…
Cancel
Save