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/29/2007 22:48:04
Content-Type: multipart/mixed; boundary="sdtB3X0nJg68CQEu"
Content-Disposition: inline

Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello Jeremy,

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 your problem was interesting and I try to
solve it via a simple Perl scrip. BTW, I'm not a Perl coder and I'm only
a Perl and C newbie, so this is a quick & dirty script, but I tryed to
do my best. ;)

For this script we need only wip/p5-PDF-Reuse.

I tested this script with ``The pkgsrc guide'', so this is an example:

 $ ftp
  We want the Chapter 2, ``Where to get pkgsrc and how to keep it up
 $ ./ pkgsrc.pdf 16 18 > chapter2.pdf

So its usage is very simple:

 ./ <our.pdf> <first_page> <last_page> > ourcutted.pdf

HTH and good luck Jeremy! :)

Ciao, Leonardo
 Leonardo Taccari (leot) |

Content-Type: application/x-perl
Content-Disposition: attachment; filename=""
Content-Transfer-Encoding: quoted-printable

#!/usr/pkg/bin/perl=0A=0A#, a quick and dirty script to cut ou=
t some pages from a PDF=0A# Leonardo Taccari, leonardo1990[at]gmail[dot]com=
=0A=0Ause warnings;=0Ause strict;=0Ause PDF::Reuse;=0A=0A# Read the options=
 from the shell via @ARGV=0Amy ($mypdf, $firstpage, $lastpage) =3D @ARGV;=
=0A=0A# Open our final PDF and put it to STDOUT=0AprFile();=0A=0A# Get page=
s from $firstpage to $lastpage in our $mypdf=0AprDoc($mypdf, $firstpage, $l=
astpage);=0A=0A# Close our PDF=0AprEnd();=0A

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

Version: GnuPG v1.4.7 (NetBSD)