denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Denemo-devel] Quick Export PDF (was Re: [bug #55770] file title on wind


From: Richard Shann
Subject: [Denemo-devel] Quick Export PDF (was Re: [bug #55770] file title on window doesn't change when file is renamed)
Date: Sun, 24 Feb 2019 19:02:23 +0000

On Sun, 2019-02-24 at 17:13 +0000, Joe Wilkinson wrote:
> Presumably I could create a button to run such a script.

yes, there is a button in the Scheme window to let you do that
> and also, presumably, edit the script so it could pick up the
> tagline, 
> or the Score Title and add the .pdf?

Well, you could pick up the score's file name and add the ".pdf" quite
trivially.

(d-ExportPDF (string-append (d-GetFilename) ".pdf"))

and you could remove the trailing ".denemo" and replace it with ".pdf"
using this

(d-ExportPDF (regexp-substitute #f (string-match ".denemo" (d-GetFilename))
                   'pre ".pdf"))


Your other ideas are fraught with trouble, though - the tagline could
be done

(d-ExportPDF (string-append (d-DirectiveGet-scoreheader-display "ScoreTagline") 
".pdf"))

but here there is a problem of sorting out which folder it will go in -
by default it will go into the temporary directory where LilyPond does
its work.
Likewise you can get the title:

(assq-ref (eval-string (d-DirectiveGet-scoreheader-data "ScoreTitles")) 'title)

(if you are using simple titles) but creating a path to save the PDF to
would require more work. 

Both the tagline and title suffer from the problem that depending on
what you have set them to they may make an invalid file name.

HTH

Richard






reply via email to

[Prev in Thread] Current Thread [Next in Thread]