Re: [gentoo-user] Re: Command line tool to crop PDF documents?

2020-05-21 Thread Ashley Dixon
On Thu, May 21, 2020 at 03:16:36PM -, 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



signature.asc
Description: PGP signature


[gentoo-user] Re: Command line tool to crop PDF documents?

2020-05-21 Thread Grant Edwards
On 2020-05-21, Ashley Dixon  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









[gentoo-user] Re: Command line tool to crop PDF documents?

2020-05-21 Thread Grant Edwards
On 2020-05-21, Ashley Dixon  wrote:
> On Thu, May 21, 2020 at 02:21:26PM -, 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