lilypond-user
[Top][All Lists]
Advanced

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

Re: More PDF metadata


From: Henning Hraban Ramm
Subject: Re: More PDF metadata
Date: Mon, 30 Aug 2010 20:40:05 +0200

Am 2010-08-30 um 01:50 schrieb M Watts:

On 08/29/2010 12:33 AM, Henning Hraban Ramm wrote:
Is it possible to insert PDF metadata (pdfmarks) into LilyPond's
PostScript output?
I use pdftk for this (and other cool stuff)
http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/

To add metadata, you write a text file that looks like
...
(or possibly extract the info from your .ly with some sed incantation)


Hm, needed a while for the incantation:

        echo "InfoKey: Title" > $1_pdfinfo.txt
sed -n -e 's/^[[:blank:]]*title.* \"\(.*\)\"\s*$/InfoValue: \1/p' $1.ly >> $1_pdfinfo.txt
        echo "InfoKey: Author" >> $1_pdfinfo.txt
sed -n -e 's/^[[:blank:]]*poet.* \"\(.*\)\"\s*$/InfoValue: \1/p' $1.ly >> $1_pdfinfo.txt
        echo "InfoKey: Composer" >> $1_pdfinfo.txt
sed -n -e 's/^[[:blank:]]*composer.* \"\(.*\)\"\s*$/InfoValue: \1/p' $1.ly >> $1_pdfinfo.txt
        echo "InfoKey: Subject" >> $1_pdfinfo.txt
sed -n -e 's/^[[:blank:]]*source.* \"\(.*\)\"\s*$/InfoValue: \1/p' $1.ly >> $1_pdfinfo.txt
        pdftk $1.pdf update_info $1_pdfinfo.txt output $1.pdf
        #open $1.pdf
        rm $1_pdfinfo.txt

I was too tired for trying more tricks to get poet and composer together into the Author field; sed doesn't understand "or" patterns like (poet|composer)

But I still think LilyPond could do this internally...


Greetlings from Lake Constance
---
fiëé visuëlle
Henning Hraban Ramm
http://www.fiee.net
http://angerweit.tikon.ch/lieder/
https://www.cacert.org (I'm an assurer)





reply via email to

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