Created
December 2, 2025 21:57
-
-
Save Metaxal/bd02d44439beb955b7a87bef0c31faea to your computer and use it in GitHub Desktop.
Pict to pdf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket/base | |
| (require pict | |
| racket/draw | |
| racket/class | |
| define2) | |
| (provide (all-defined-out)) | |
| (define (pict->pdf scene out-file) | |
| (define pdf-dc | |
| (new pdf-dc% | |
| [interactive #f] | |
| [width (* .82 (pict-width scene))] | |
| [height (* .82 (pict-height scene))] | |
| [output out-file])) | |
| (send pdf-dc start-doc "start pdf") | |
| (send pdf-dc start-page) | |
| (draw-pict scene pdf-dc 0 0) | |
| (send pdf-dc end-page) | |
| (send pdf-dc end-doc)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment