Subject: Re: wip/pdftk and NetBSD 4.0 and gcj: libgcj.spec: No such file or directory
To: pkgsrc-users <>
From: Leonardo Taccari <>
List: pkgsrc-users
Date: 12/30/2007 14:15:08
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello Jeremy and all pkgsrc-users,

On Sat, Dec 29, 2007 at 10:26:08AM -0600, Jeremy C. Reed wrote:
> p.s. I just need to cut out some PDF pages. texexec loses the page size=
> and changes formatting but pdftk works good last time I used it. gv=20
> converting PDF and saving selected pages to postscript looks terrible=20
> (loses font details?). If anyone knows of an alternative, please let me=
> know.
I don't know wip/pdftk, but this problem was interesting so I tryed to
write a solution. BTW I'm not a Perl coder, I only like to code in C and
Perl, so this script is probably horrible. For this Perl script you need
only wip/p5-PDF-Reuse.

For example we want to take the 2nd chapter in ``The pkgsrc guide'':

 $ ./ pkgsrc.pdf 16 18 > chapter2.pdf
So the syntax is:

 $ ./ <input.pdf> <first_page> <last_page> > <output.pdf>

This is the script:

#, a quick and dirty script to cut out some pages from a PDF
# Leonardo Taccari, leonardo1990[at]gmail[dot]com

use warnings;
use strict;
use PDF::Reuse;

# Read the options from the shell via @ARGV
my ($mypdf, $firstpage, $lastpage) =3D @ARGV;

# Open our final PDF and put it to STDOUT

# Get pages from $firstpage to $lastpage in our $mypdf
prDoc($mypdf, $firstpage, $lastpage);

# Close our PDF

HTH and good luck Jeremy. :)

Ciao, Leonardo
 Leonardo Taccari (leot) |

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.7 (NetBSD)