lilypond-user
[Top][All Lists]
Advanced

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

Re: Crop only top and bottom


From: David Wright
Subject: Re: Crop only top and bottom
Date: Tue, 16 Jan 2018 08:59:28 -0600
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue 16 Jan 2018 at 13:26:34 (+0100), Urs Liska wrote:
> Am 16.01.2018 um 12:49 schrieb Werner LEMBERG:
> >>I have looked for ways to crop the EPS to only two borders of the
> >>bounding box but didn't find anything useful so far.
> >While I can't help with the lilypond issue, I suggest to have a look
> >at the `pdfcrop' program that comes with TeXLive: It supports a
> >`--margins' option.
> 
> Unfortunately that doesn't help, as this only allows to *add* margins.
> I think it is only a wrapper using Ghostscript anyway, so there
> should be a direct solution. It's possible to specify the box to be
> cropped using Ghostscript, and it is possible to crop to the
> content, which is what LilyPond does (-dEPSCrop).

… which is what pdfcrop does. The margins are then added to the
cropped content.

There are options in pdfcrop for overriding the PS bounding box,
but I haven't tried using them as I only ever process the
content-cropped file as a PDF in LaTeX. Nowadays, PS files don't
form any part of my workflow, beyond legacy trivia like
    paps <some file> | ps2pdf - -

> For the function I need it would be necessary to retrieve the
> document width and the content box of the original file and then
> crop it ignoring the left and right part of the bounding box.
> However, so far I'm poking in the fog and haven't found the proper
> way to do it.
> I need a way to compile a score with LilyPond so these informations
> are present in the resulting file (PDF or EPS) so I can read it
> either directly from the file or using some tools like pdfinfo or
> similar.
> 
> Any suggestions?

One path might be to investigate printing a 1 pixel dot at a given
absolute distance to the left of the start of the system, measured
from the start of the staff lines. I've not enough knowledge of LP
internals to know whether this is possible.
Pdfcrop will see the dot, and any added L margin will be measured
from that point.

Cheers,
David.



reply via email to

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