- (search-executable '("gs-nox" "gs-8.15" "gs")))
-
-(define-public (postscript->pdf papersizename name)
- (let* ((pdf-name (string-append (basename name ".ps") ".pdf"))
- (cmd (format #f
+
+ ;; must be sure that we don't catch stuff from old GUBs.
+ (search-executable '("gs")))
+
+(define-public (postscript->pdf paper-width paper-height name)
+ (let* ((pdf-name (string-append
+ (dir-basename name ".ps" ".eps")
+ ".pdf"))
+ (is-eps (string-match "\\.eps$" name))
+ (paper-size-string (if is-eps
+ " -dEPSCrop "
+ (ly:format "-dDEVICEWIDTHPOINTS=~$ \
+-dDEVICEHEIGHTPOINTS=~$ "
+ paper-width paper-height )))
+
+ (cmd (simple-format #f