diff --git a/pitfall/pitfall/page.rkt b/pitfall/pitfall/page.rkt index c18918d9..bd61be2d 100644 --- a/pitfall/pitfall/page.rkt +++ b/pitfall/pitfall/page.rkt @@ -8,7 +8,10 @@ (provide (all-defined-out)) -(define (current-page doc) (car (pdf-pages doc))) +(define (current-page doc) + (match (pdf-pages doc) + [(? pair? ps) (car ps)] + [_ (raise-argument-error 'current-page "no pages in pdf" doc)])) (define (add-content doc data) (page-write (current-page doc) data))