handle more metadata fields

main
Matthew Butterick 5 years ago
parent d579da879a
commit 8f6b184fca

@ -49,6 +49,16 @@
(parse-1 ip)
(port->bytes ip)) #"z"))
(define excluded-keys
(list #"/Producer"
#"/Creator"
#"/CreationDate"
#"/ModDate"
#"/Keywords"
#"/Title"
#"/Author"
#"/Subject"))
(define (parse-1 ip)
(cond
;; the complication is that arrays & dicts can contain other arrays & dicts
@ -62,7 +72,7 @@
(sort ; put hash into order so it's comparable
(for/list ([kv (in-slice 2 items)]
;; suppress these keys so we can compare pdfkit & pitfall output
#:unless (member (car kv) (list #"/Producer" #"/Creator" #"/CreationDate")))
#:unless (member (car kv) excluded-keys))
(apply cons kv))
bytes<?
#:key car))

@ -32,9 +32,12 @@
;; initial values
(define pages null)
(define refs null)
(define info (mhasheq 'Producer "PITFALL"
'Creator "PITFALL"
'CreationDate (current-seconds)))
(define now (current-seconds))
(define producer (format "Racket ~a (Pitfall library)" (version)))
(define info (mhasheq 'Producer producer
'Creator producer ; or application program using Pitfall
'CreationDate now
'ModDate now))
(define opacity-registry (make-hash))
(define current-fill-color '("black" 1))
(define ctm default-ctm-value)

Loading…
Cancel
Save