public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Command line tool to crop PDF documents?
@ 2020-05-21 14:21 Grant Edwards
  2020-05-21 14:26 ` Ashley Dixon
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Edwards @ 2020-05-21 14:21 UTC (permalink / raw
  To: gentoo-user

I'm looking for a command-line tool to crop a multi-page PDF document.

I want to specify the crop window on the command line.

I don't want it to automagically remove all of the marginal
whitespace.

I don't want GUI where I have to draw a box.

Google has found various references to 'croppdf' which is included in
a package of texlive extra utilities on Ubuntu.  Gentoo seems have 38
different 'texlive' ebuilds.  Is there any way to tell which (if any)
contains croppdf?

--
Grant




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Command line tool to crop PDF documents?
  2020-05-21 14:21 [gentoo-user] Command line tool to crop PDF documents? Grant Edwards
@ 2020-05-21 14:26 ` Ashley Dixon
  2020-05-21 14:36   ` Ashley Dixon
  2020-05-21 14:49   ` Grant Edwards
  0 siblings, 2 replies; 6+ messages in thread
From: Ashley Dixon @ 2020-05-21 14:26 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

On Thu, May 21, 2020 at 02:21:26PM -0000, Grant Edwards wrote:
> I'm looking for a command-line tool to crop a multi-page PDF document.
> 
> I want to specify the crop window on the command line.
> 
> I don't want it to automagically remove all of the marginal
> whitespace.
> 
> I don't want GUI where I have to draw a box.

How about pdfcrop from app-text/texlive-core ?  It allows you  manually  specify
many things, although it does, inevitably, increase the file size for  documents
with many pages.

> Google has found various references to 'croppdf' which is included in
> a package of texlive extra utilities on Ubuntu.  Gentoo seems have 38
> different 'texlive' ebuilds.  Is there any way to tell which (if any)
> contains croppdf?

You can use the e-file command from app-portage/pfl to check  which  package  in
Portage provides a specific  file---including  binaries.   Emerge  pfl  and  run
`e-file pdfcrop`.

-- 

Ashley Dixon
suugaku.co.uk

2A9A 4117
DA96 D18A
8A7B B0D2
A30E BF25
F290 A8AA


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Command line tool to crop PDF documents?
  2020-05-21 14:26 ` Ashley Dixon
@ 2020-05-21 14:36   ` Ashley Dixon
  2020-05-21 15:16     ` [gentoo-user] " Grant Edwards
  2020-05-21 14:49   ` Grant Edwards
  1 sibling, 1 reply; 6+ messages in thread
From: Ashley Dixon @ 2020-05-21 14:36 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

On Thu, May 21, 2020 at 03:26:37PM +0100, Ashley Dixon wrote:
> On Thu, May 21, 2020 at 02:21:26PM -0000, Grant Edwards wrote:
> > I'm looking for a command-line tool to crop a multi-page PDF document.
> > 
> > I want to specify the crop window on the command line.
> > 
> > I don't want it to automagically remove all of the marginal
> > whitespace.
> > 
> > I don't want GUI where I have to draw a box.
> 
> How about pdfcrop from app-text/texlive-core ?  It allows you  manually  specify
> many things, although it does, inevitably, increase the file size for  documents
> with many pages.

There is also [1], which is a slightly improved version of  Oberdiek's  pdfcrop.
It uses pure GhostScript and Perl to work around some of the caveats of pdfcrop,
including  preserving  interactive  content  (such  as  hyperref  links  in  TeX
documents) and allowing you to avoid emerging the huge texlive-core package  for
one small utility.

[1] https://tex.stackexchange.com/a/42259/

-- 

Ashley Dixon
suugaku.co.uk

2A9A 4117
DA96 D18A
8A7B B0D2
A30E BF25
F290 A8AA


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-user] Re: Command line tool to crop PDF documents?
  2020-05-21 14:26 ` Ashley Dixon
  2020-05-21 14:36   ` Ashley Dixon
@ 2020-05-21 14:49   ` Grant Edwards
  1 sibling, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2020-05-21 14:49 UTC (permalink / raw
  To: gentoo-user

On 2020-05-21, Ashley Dixon <ash@suugaku.co.uk> wrote:
> On Thu, May 21, 2020 at 02:21:26PM -0000, Grant Edwards wrote:

>> Google has found various references to 'croppdf' which is included
>> in a package of texlive extra utilities on Ubuntu.  Gentoo seems
>> have 38 different 'texlive' ebuilds.  Is there any way to tell
>> which (if any) contains croppdf?
>
> You can use the e-file command from app-portage/pfl to check which
> package in Portage provides a specific file---including binaries.
> Emerge pfl and run `e-file pdfcrop`.

Yep.  It looks like pdfcrop from texlive-core will do what I want.  It
would have helped if I hadn't trasmuted "pdfcrop" to "croppdf" when I
was searching for info!

I initially just trield downloading pdfcrop.pl and running it without
texlive installed, but it relies on texpdf.

--
Grant





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-user] Re: Command line tool to crop PDF documents?
  2020-05-21 14:36   ` Ashley Dixon
@ 2020-05-21 15:16     ` Grant Edwards
  2020-05-21 15:27       ` Ashley Dixon
  0 siblings, 1 reply; 6+ messages in thread
From: Grant Edwards @ 2020-05-21 15:16 UTC (permalink / raw
  To: gentoo-user

On 2020-05-21, Ashley Dixon <ash@suugaku.co.uk> wrote:

> There is also [1], which is a slightly improved version of  Oberdiek's  pdfcrop.
> It uses pure GhostScript and Perl to work around some of the caveats of pdfcrop,
> including  preserving  interactive  content  (such  as  hyperref  links  in  TeX
> documents) and allowing you to avoid emerging the huge texlive-core package  for
> one small utility.
>
> [1] https://tex.stackexchange.com/a/42259/

I don't see any pure Perl/Ghostscript utility in that thread.  There's
a bash program, but it doesn't support compression in input files.

The pdfcrop.pl included in texlive seems to work OK with compressed
input files, but the output filesize balloons up by about 6X.

This app did work beautifully with no fuss:

  https://pypi.org/project/pdfCropMargins/
  https://github.com/abarker/pdfCropMargins

I can remove the crop marks from a PDF book, and then keep as much or
little of the remaining whitespace margins as I want.  The output file
is smaller than the input file (which is sort of what you'd expect
when you're removing stuff).

Now I can uninstall TexLive until the next time I need to tweak my
résumé. :) I usually do have TexLive installed, but a while back it
was causing a blockage when trying to do an update. So I uninstalled
it in order to get on the the 'emerge -auvND world' and never got
around to re-installing it until today.

--
Grant








^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] Re: Command line tool to crop PDF documents?
  2020-05-21 15:16     ` [gentoo-user] " Grant Edwards
@ 2020-05-21 15:27       ` Ashley Dixon
  0 siblings, 0 replies; 6+ messages in thread
From: Ashley Dixon @ 2020-05-21 15:27 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1404 bytes --]

On Thu, May 21, 2020 at 03:16:36PM -0000, Grant Edwards wrote:
> I don't see any pure Perl/Ghostscript utility in that thread.  There's
> a bash program, but it doesn't support compression in input files.

Yes, it's Bash; I mentioned Perl and GhostScript as they are dependencies of the
script.

> Now I can uninstall TexLive until the next time I need to tweak my
> résumé. :) I usually do have TexLive installed, but a while back it
> was causing a blockage when trying to do an update. So I uninstalled
> it in order to get on the the 'emerge -auvND world' and never got
> around to re-installing it until today.

This is a known issue with some of the  language  packages  hard-blocking  newer
versions of the base TeXLive packages, as a new  release  of  the  base  doesn't
necessarily mandate a new release of all the subsidiary  packages  [1].   For  a
number of years, I (uses TeX every  day)  just  used  the  standalone  installer
provided by TUG.org, as the blocking used to be much harder to resolve.

        $ eix '-I#' dev-texlive/texlive-lang > texlive-lang-packages
        $ emerge --deselect=n --unmerge texlive-latex texlive-basic \
                $(cat texlive-lang-packages)
        $ emerge -uDN1a @world

[1] https://wiki.gentoo.org/wiki/TeX_Live#Upgrading

-- 

Ashley Dixon
suugaku.co.uk

2A9A 4117
DA96 D18A
8A7B B0D2
A30E BF25
F290 A8AA


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-21 15:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-21 14:21 [gentoo-user] Command line tool to crop PDF documents? Grant Edwards
2020-05-21 14:26 ` Ashley Dixon
2020-05-21 14:36   ` Ashley Dixon
2020-05-21 15:16     ` [gentoo-user] " Grant Edwards
2020-05-21 15:27       ` Ashley Dixon
2020-05-21 14:49   ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox