main
Matthew Butterick 8 years ago
parent 741a7e1c24
commit fc3a1070e1

@ -7,7 +7,7 @@
(define PDFDocument
(class object% ; actually is an instance of readable.Stream, which is an input port
(init-field [(@options options) (mhasheq)])
(init-field [(@options options) (mhash)])
(let ([output-file (hash-ref @options 'out "outrkt.pdf")])
(super-new))
@ -31,9 +31,9 @@
(field [(@_offset _offset) 0])
(field [(@_root _root) (@ref
(mhasheq 'Type "Catalog"
(mhash 'Type "Catalog"
'Pages (@ref
(mhasheq 'Type "Pages"
(mhash 'Type "Pages"
'Count 0
'Kids empty))))])
@ -54,7 +54,7 @@
#;(@initImages)
;; Initialize the metadata
(field [(@info info) (mhasheq
(field [(@info info) (mhash
'Producer "PitfallKit"
'Creator "PitfallKit"
'CreationDate (seconds->date (current-seconds)))])
@ -189,7 +189,7 @@
(@_write "trailer")
;; todo: make `PDFObject:convert` a static method
(@_write (send (make-object PDFObject) convert
(mhasheq 'Size (add1 (length @_offsets))
(mhash 'Size (add1 (length @_offsets))
'Root @_root
'Info @_info)))

@ -4,12 +4,12 @@
(define PDFReference
(class object%
(init-field [(@document document)] [(@id id)] [(@data data) (mhasheq)])
(super-new)
(init-field [(@document document)] [(@id id)] [(@data data) (mhash)])
(field [(@gen gen) 0])
(field [(@deflate deflate) #f])
(field [(@compress compress) (and (with-handlers ([exn:fail:contract? (λ (exn) #f)])
(get-field compress @document)) (not (hash-ref @data 'Filter #f)))])
(field [(@compress compress) (and (· @document compress)
(not (hash-ref @data 'Filter #f)))])
(field [(@uncompressedLength uncompressedLength) 0])
(field [(@chunks chunks) empty])

Loading…
Cancel
Save