[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tabloid paper size - how I got it working
From: |
Marcus Macauley |
Subject: |
Tabloid paper size - how I got it working |
Date: |
Tue, 15 Feb 2005 15:27:55 -0500 |
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:
<snip>
Layout output to `strtrio-vln.ps'...
<snip>
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:
PAPERSIZE X inches Y inches X cm Y cm
-----------------------------------------------------
a0 33.0556 46.7778 83.9611 118.816
a1 23.3889 33.0556 59.4078 83.9611
a2 16.5278 23.3889 41.9806 59.4078
a3 11.6944 16.5278 29.7039 41.9806
a4 8.26389 11.6944 20.9903 29.7039
a5 5.84722 8.26389 14.8519 20.9903
a6 4.125 5.84722 10.4775 14.8519
a7 2.91667 4.125 7.40833 10.4775
a8 2.05556 2.91667 5.22111 7.40833
a9 1.45833 2.05556 3.70417 5.22111
a10 1.02778 1.45833 2.61056 3.70417
b0 39.3889 55.6667 100.048 141.393
b1 27.8333 39.3889 70.6967 100.048
b2 19.6944 27.8333 50.0239 70.6967
b3 13.9167 19.6944 35.3483 50.0239
b4 9.84722 13.9167 25.0119 35.3483
b5 6.95833 9.84722 17.6742 25.0119
archA 9 12 22.86 30.48
archB 12 18 30.48 45.72
archC 18 24 45.72 60.96
archD 24 36 60.96 91.44
archE 36 48 91.44 121.92
flsa 8.5 13 21.59 33.02
flse 8.5 13 21.59 33.02
halfletter 5.5 8.5 13.97 21.59
note 7.5 10 19.05 25.4
letter 8.5 11 21.59 27.94
legal 8.5 14 21.59 35.56
11x17 11 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 consistent), but since it worked that way I didn't bother
to go back and change it.
So I made similar changes to the gs_statd.ps files for the other
ghostscript versions.
Then I edited the Lilypond file, specifying tabloid/landscape (which is
what I really wanted), ran Lilypond on it again, and it generated no
errors about PS or PDF, as it had before (just some musical warnings - bar
checks, etc.).
Then, trying to open each file (PS and PDF) with KGhostView, KPDF, GGV,
and GPDF, here's what worked/didn't work:
- KGhostView opened the PS file, but displayed it incorrectly (music at
the bottom of the page, overflowing, etc). Choosing View - Paper Size -
11x17 fixed it; now it displayed tabloid landscape, with the music
formatted correctly. However, I couldn't get it to display the PDF without
getting the orientation wrong in one way or another.
- KPDF displayed the PDF correctly upon opening it - no modifications
necessary!
- GGV refused to open the PS, complaining "File is not a valid PostScript
document". However, it displayed the PDF just fine, except that the whole
page was rotated. In other words, the music fit, spanning the length (17
inches) of the page, but the page was displayed in portrait orientation
with the staff lines vertical. Choosing View - Orientation - Landscape
rotated it correctly, but the music was cut off past 11 inches wide.
- GPDF, like KPDF, displayed the PDF correctly the first time!
Hopefully that helps, and if there's an easier/more reliable way to make
this work, I'd be happy to hear about it!
BTW, I'm still not sure which version of Ghostscript Lilypond is using;
all I know is that typing "gs --version" at a command prompt displays
"8.15", while typing "ghostscript --version" displays "7.07". I suppose I
could make symbolic links in the /usr/bin or /usr/local/bin directories to
choose which version I wanted to use, but now that it's at least working I
feel more like leaving it alone!
Marcus Macauley
- Tabloid paper size - how I got it working,
Marcus Macauley <=