[Top][All Lists]

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

Re: generating pdf and png but no ps

From: Alexander Kobel
Subject: Re: generating pdf and png but no ps
Date: Fri, 03 Oct 2008 16:13:30 +0200
User-agent: Thunderbird (Macintosh/20080914)

Sebastian Menge wrote:
> How can I generate pdf and png but no ps?
AFAIK for what you want, no; LilyPond needs the PS for PDF output.
IIRC, recently there was a discussion about implementing a switch to
automatically delete the intermediate PS, but currently there is none.
So you'll have to call a rm yourself. (Which does not harm too much;
it's not that rm generates much traffic even for a very restricted and
low-powered PHP server, is it?)

Wohoo. Just saw Gilles' mail; I think there's some possibility to call
the scheme command from the commandline, too, but you seem to need a
guile-user thingie... Not sure if this really helps, then. See the first
paragraph here:

> Can I adjust resolution of the png? I just need thumbnails.
Grep for dresolution here:
But: You may end up faster generating the PDF (which you seem to need
anyway) and use convert (ImageMagick) or gs or something to get the PNG;
you won't need a second engraving run then. (Is it possible to use --png
and --pdf output in Lily simultaneously? Never bothered...)

> Is there a simple way to see (e.g. from the shell or an external
> programming language) how many png-pages lilypond produced?
Well, three things come into my mind.

> --png produces file-page1.png file-page2.png etc.
First, quick 'n' dirty:
        ls -1 "file-page*.png" | wc -l
(This is the digit one after ls (one entry per line), and the letter L
after wc (count lines).)
Make sure there's nothing else matching to the filename pattern.
Otherwise you could do a bash loop and count until there's no file of
the expected name... Or try something like
        ls -1 | grep -E 'file-page[0-9]+\.png' | wc -l

But, since you generate the pdf anyway:
Second, using pdfinfo (which I'm not sure where it comes from, but it
seems to be standard. Maybe xpdf?):
        pdfinfo file.pdf | grep "Pages:"
and remove the "Pages:\t" in your script.

Third, same idea, and yet another advertising for the great pdftk
        pdftk file.pdf dump_data | grep "NumberOfPages:"
and remove the "NumberOfPages: " in your script.


reply via email to

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