lilypond-user
[Top][All Lists]
Advanced

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

Re: [Feature request] attach lilypond code in pdf.


From: Henning Hraban Ramm
Subject: Re: [Feature request] attach lilypond code in pdf.
Date: Mon, 9 Jul 2012 23:24:03 +0200

Am 2012-07-08 um 20:27 schrieb Da Mota Sam:

I'm a pretty much new user of lilypond and I have an idea for a almost
dummy new feature: automatically attach lilypond code in pdf.
With pdf files it is possible to attach a file into it. I think it
would be nice to have a lilypond option that attaches the .ly files
into the pdf.
This way when someone creates a partition and upload it to a website,
the code will be uploaded too, thus making it much more easier for any
user to possibly modify it.
Moreover it will help spreading the use of lilypond.

In linux it is easy to do it using pdftk (the command is "pdftk
input_file.pdf attach_files source_file.ly output output_file.pdf").
It may be interesting to automatically call this command just after
the pdf generation. Pdftk seems to be also available under windows and
mac os.

Moreover, if this feature is accepted, it may be interesting to modify
the default tagline which says "engraved by lilypond version x.y.z" to
"engraved by lilypond version x.y.z with source file attached" to
increase its visibility.

Of course, for musicians who doesn't want to share their lilypond
code, this feature should be kept as an option (maybe turned on by
default).

I used pdftk within my lilypond wrapper script (that also computes a nice transparent PNG) in the same way, but cannot ATM, since pdftk doesn’t compile anymore on OSX.

Read a bit around, and you see why depending on pdftk would be a bad choice for LilyPond (I didn’t even check the license): It compiles only on two selected oldish versions of GCC and needs the (otherwise not so common) Java backend. Maybe it’s still possible on some Linux variants, but e.g. not on OSX. And it’s not supported/ developed any more. LilyPond’s dependencies are already peculiar enough, let’s not burden us with another complicated one.

There might be a solution using a Python library (pyPdf or better pdfrw), but I had no time yet to check it out. Or we don’t need a library at all, if we can put the right /pdfmarks in LilyPond’s PostScript. It would be easy for header information, don’t know about the attachment. And since I can’t do it myself, it won’t happen, if none of the wizards sees the need. (I can collect the /pdfmark information - I once used to patch EPS files prior distillation - but won’t dive into LilyPond’s PS generator code.)

David, what would you charge?

Greetlings, Hraban
---
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]