Re: Tabloid paper size - how I got it working

2005-02-16 Thread Mats Bengtsson
LilyPond calls the program ps2pdf, which in its turn calls gs, so
in your case it runs version 8.15.
An alternative to hacking in the Ghostscript installation is to
take the PS file generated by LilyPond and manually convert it
into PDF using
ps2pdf -sPAPERSIZE=11x17 strtrio-vln.ps
We should probably add a table lookup in LilyPond so it the LilyPond
paper size name is translated into the corresponding Ghostscript paper
size name before calling ps2pdf.
   /Mats
Marcus Macauley wrote:
I was getting ready to write this list asking if anyone had had luck
generating tabloid (11x17) PS/PDFs from Lilypond, but in the process, I
figured out how to do it.
Since I'm not sure exactly what it was I did that made it work, and since
I have three versions of Ghostscript (7.07, 8.15, and 8.50) installed, not
sure which one Lilypond is using, I thought I'd post my experiences here
so they might be useful to someone who's trying to format tabloid scores
or to the developers.
I'm running Fedora Core 3, and have gotten two versions of Lilypond
successfully installed and working from RPMs: first, 2.4.2; currently,
2.5.3.
With both versions of Lilypond, I tried specifying the paper size
according to the documentation, which worked fine for letter and legal
sized paper, at both portrait (default) and landscape orientations:
#(set-default-paper-size "letter" 'landscape)
But while those sizes/orientations worked fine, specifying tabloid (with
or without the 'landscape option) generated an error something like this:
   
Layout output to `strtrio-vln.ps'...
   
Converting to `strtrio-vln.pdf'...Error invoking `ps2pdf 
-sPAPERSIZE="tabloid" strtrio-vln.ps > /dev/null 2>&1 '. Return value
65280

Although it looks like the PS file was generated, and the problem occured
in converting it to PDF, actually the PS file would appear to be somewhat
messed up - KGhostView would open it, but show a letter-size page with
(overflowing) tabloid music, while GGV wouldn't open it at all, saying
"File is not a valid PostScript document."
The PDF, meanwhile, was not generated at all.
But then I typed "info ghostscript" (which says its based on version
7.07), and I came across the following information on paper sizes:
=== begin quote ===
To select a specific paper size, use the command line switch
 -sPAPERSIZE=a_known_paper_size
for instance
 -sPAPERSIZE=a4
or
 -sPAPERSIZE=legal
At this time, the known paper sizes,  defined  in  the  initialization
file "gs_statd.ps", are:
PAPERSIZEX inches   Y inches   X cm  Y cm
-
a0   33.055646.777883.9611   118.816
a1   23.388933.055659.4078   83.9611
a2   16.527823.388941.9806   59.4078
a3   11.694416.527829.7039   41.9806
a4   8.2638911.694420.9903   29.7039
a5   5.847228.2638914.8519   20.9903
a6   4.125  5.8472210.4775   14.8519
a7   2.916674.125  7.40833   10.4775
a8   2.055562.916675.22111   7.40833
a9   1.458332.055563.70417   5.22111
a10  1.027781.458332.61056   3.70417
b0   39.388955.6667100.048   141.393
b1   27.833339.388970.6967   100.048
b2   19.694427.833350.0239   70.6967
b3   13.916719.694435.3483   50.0239
b4   9.8472213.916725.0119   35.3483
b5   6.958339.8472217.6742   25.0119
archA9  12 22.86 30.48
archB12 18 30.48 45.72
archC18 24 45.72 60.96
archD24 36 60.96 91.44
archE36 48 91.44 121.92
flsa 8.513 21.59 33.02
flse 8.513 21.59 33.02
halfletter   5.58.513.97 21.59
note 7.510 19.05 25.4
letter   8.511 21.59 27.94
legal8.514 21.59 35.56
11x1711 17 27.94 43.18
ledger   17 11 43.18 27.94
Note that the B paper sizes are ISO sizes: for information about using
JIS B sizes, see Use.htm.
=== end quote ===
Note that there is no "tabloid", only "11x17" (i.e. "tabloid" 'portrait)
and ledger (i.e. "tabloid" 'landscape). But I can't specify 11x17 or
ledger in Lilypond, because it doesn't recognize this.
So I tried searching for that "gs_statd.ps" mentioned in the above info
document, to see if maybe I could customize it. Doing:
find / -name gs_statd.ps
I found three copies, one corresponding to each version of ghostscript I
have installed (only the first, 7.07, from an RPM):
/usr/share/ghostscript/7.07/lib/gs_statd.ps
/usr/local/share/ghostscript/8.15/lib/gs_statd.ps
/usr/local/share/ghostscript/8.50/lib/gs_statd.ps
Editing each file in turn, I found a line (around line 41) like:
 /11x17 {792 1224 //.setpagesize exec} bind def  %

Tabloid paper size - how I got it working

2005-02-15 Thread Marcus Macauley
I was getting ready to write this list asking if anyone had had luck
generating tabloid (11x17) PS/PDFs from Lilypond, but in the process, I
figured out how to do it.

Since I'm not sure exactly what it was I did that made it work, and since
I have three versions of Ghostscript (7.07, 8.15, and 8.50) installed, not
sure which one Lilypond is using, I thought I'd post my experiences here
so they might be useful to someone who's trying to format tabloid scores
or to the developers.

I'm running Fedora Core 3, and have gotten two versions of Lilypond
successfully installed and working from RPMs: first, 2.4.2; currently,
2.5.3.

With both versions of Lilypond, I tried specifying the paper size
according to the documentation, which worked fine for letter and legal
sized paper, at both portrait (default) and landscape orientations:

#(set-default-paper-size "letter" 'landscape)

But while those sizes/orientations worked fine, specifying tabloid (with
or without the 'landscape option) generated an error something like this:

   
Layout output to `strtrio-vln.ps'...
   
Converting to `strtrio-vln.pdf'...Error invoking `ps2pdf 
-sPAPERSIZE="tabloid" strtrio-vln.ps > /dev/null 2>&1 '. Return value
65280

Although it looks like the PS file was generated, and the problem occured
in converting it to PDF, actually the PS file would appear to be somewhat
messed up - KGhostView would open it, but show a letter-size page with
(overflowing) tabloid music, while GGV wouldn't open it at all, saying
"File is not a valid PostScript document."

The PDF, meanwhile, was not generated at all.

But then I typed "info ghostscript" (which says its based on version
7.07), and I came across the following information on paper sizes:

=== begin quote ===
To select a specific paper size, use the command line switch

 -sPAPERSIZE=a_known_paper_size

for instance

 -sPAPERSIZE=a4
or
 -sPAPERSIZE=legal

At this time, the known paper sizes,  defined  in  the  initialization
file "gs_statd.ps", are:

PAPERSIZEX inches   Y inches   X cm  Y cm
-
a0   33.055646.777883.9611   118.816
a1   23.388933.055659.4078   83.9611
a2   16.527823.388941.9806   59.4078
a3   11.694416.527829.7039   41.9806
a4   8.2638911.694420.9903   29.7039
a5   5.847228.2638914.8519   20.9903
a6   4.125  5.8472210.4775   14.8519
a7   2.916674.125  7.40833   10.4775
a8   2.055562.916675.22111   7.40833
a9   1.458332.055563.70417   5.22111
a10  1.027781.458332.61056   3.70417
b0   39.388955.6667100.048   141.393
b1   27.833339.388970.6967   100.048
b2   19.694427.833350.0239   70.6967
b3   13.916719.694435.3483   50.0239
b4   9.8472213.916725.0119   35.3483
b5   6.958339.8472217.6742   25.0119
archA9  12 22.86 30.48
archB12 18 30.48 45.72
archC18 24 45.72 60.96
archD24 36 60.96 91.44
archE36 48 91.44 121.92
flsa 8.513 21.59 33.02
flse 8.513 21.59 33.02
halfletter   5.58.513.97 21.59
note 7.510 19.05 25.4
letter   8.511 21.59 27.94
legal8.514 21.59 35.56
11x1711 17 27.94 43.18
ledger   17 11 43.18 27.94

Note that the B paper sizes are ISO sizes: for information about using
JIS B sizes, see Use.htm.
=== end quote ===

Note that there is no "tabloid", only "11x17" (i.e. "tabloid" 'portrait)
and ledger (i.e. "tabloid" 'landscape). But I can't specify 11x17 or
ledger in Lilypond, because it doesn't recognize this.

So I tried searching for that "gs_statd.ps" mentioned in the above info
document, to see if maybe I could customize it. Doing:

find / -name gs_statd.ps

I found three copies, one corresponding to each version of ghostscript I
have installed (only the first, 7.07, from an RPM):

/usr/share/ghostscript/7.07/lib/gs_statd.ps
/usr/local/share/ghostscript/8.15/lib/gs_statd.ps
/usr/local/share/ghostscript/8.50/lib/gs_statd.ps

Editing each file in turn, I found a line (around line 41) like:

 /11x17 {792 1224 //.setpagesize exec} bind def  % 11x17 portrait

And later on, under "STRICT...", one that was commented out (approx. line
109), like:
% /tabloid {792 1224 //.setpagesize exec} bind def  % 11x17 portrait

So I removed the % from the tabloid line to enable that option.

Further down (line 124?) there was a list of "/.pagetypenames", which
included /11x17 but not /tabloid. So I added /tabloid. Actually, I added
it to the same line as /11x17 (rather than after "STRICT", which would
have been more