diff --git a/pitfall/pitfall/core.rkt b/pitfall/pitfall/core.rkt index 176de390..d3e6d083 100644 --- a/pitfall/pitfall/core.rkt +++ b/pitfall/pitfall/core.rkt @@ -20,6 +20,8 @@ (define current-pdf-version (make-parameter 1.3)) (define current-auto-first-page (make-parameter #t)) +(define current-default-margins (make-parameter (margin 72 72 72 72))) + ;; helpers (define (numberizer x #:round [round? #true]) diff --git a/pitfall/pitfall/page.rkt b/pitfall/pitfall/page.rkt index 3fff4b9a..59170b3d 100644 --- a/pitfall/pitfall/page.rkt +++ b/pitfall/pitfall/page.rkt @@ -1,13 +1,10 @@ #lang debug racket/base (require racket/class - racket/contract - sugar/unstable/class - sugar/unstable/js sugar/unstable/dict "core.rkt") -(provide (all-defined-out)) +(provide PDFPage) (define PDFPage (class object% @@ -26,8 +23,7 @@ (let ([margin-value (hash-ref @options 'margin #f)]) (if (number? margin-value) (margin margin-value margin-value margin-value margin-value) - ;; default to 1 inch margins - (hash-ref @options 'margins default-margins)))] + (hash-ref @options 'margins (current-default-margins))))] ;; The page dictionary [(@dictionary dictionary) (send @doc ref @@ -66,7 +62,6 @@ (send @resources end) (send @content end)))) -(define default-margins (margin 72 72 72 72)) (define page-sizes (hash "4A0" '(4767.87 6740.79)