-(define-public (output-framework channel book scopes fields )
- (let*
- ((ctor-arg (if (string? channel)
- (open-output-file (format "~a.socket" channel))
- channel))
- (outputter (ly:make-paper-outputter
- ctor-arg
- 'socket))
- (systems (ly:paper-book-systems book)))
+(define (get-page-dimensions paper)
+ (let* ((landscape (ly:output-def-lookup paper 'landscape))
+ (output-scale (ly:output-def-lookup paper 'output-scale))
+ (paper-width (ly:output-def-lookup paper 'paper-width))
+ (paper-height (ly:output-def-lookup paper 'paper-height))
+ (indent (ly:output-def-lookup paper 'indent))
+ (line-width (ly:output-def-lookup paper 'line-width))
+ (plain-left-margin (ly:output-def-lookup paper 'left-margin))
+ (top-margin (ly:output-def-lookup paper 'top-margin))
+ (w (if landscape paper-height paper-width))
+ (h (if landscape paper-width paper-height))
+ (left-margin (if (null? plain-left-margin)
+ (/ (- w line-width) 2)
+ plain-left-margin))
+ ;; (list w h left-margin top-margin indent line-width)))
+ ;; (convert (lambda (x) (* x output-scale (/ (ly:bp 1))))))
+ (unit-length (ly:output-def-lookup paper 'output-scale))
+ (convert (lambda (x) (* x lily-unit->mm-factor unit-length))))
+ (map convert (list w h left-margin top-margin indent line-width))))