Subject: Re: wip/pdftk and NetBSD 4.0 and gcj: libgcj.spec: No such file or directory
To: pkgsrc-users <pkgsrc-users@netbsd.org>
From: Leonardo Taccari <leonardo1990@gmail.com>
List: pkgsrc-users
Date: 12/29/2007 22:48:04
--i9LlY+UWpKt15+FH
Content-Type: multipart/mixed; boundary="sdtB3X0nJg68CQEu"
Content-Disposition: inline
--sdtB3X0nJg68CQEu
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=
=20
> 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=
=20
> 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 http://www.NetBSD.org/docs/pkgsrc/pkgsrc.pdf
[...]
We want the Chapter 2, ``Where to get pkgsrc and how to keep it up
to-date''
[...]
$ ./forjeremy.pl pkgsrc.pdf 16 18 > chapter2.pdf
So its usage is very simple:
./forjeremy.pl <our.pdf> <first_page> <last_page> > ourcutted.pdf
HTH and good luck Jeremy! :)
Ciao, Leonardo
--=20
Leonardo Taccari (leot) | http://leot.netsons.org
--sdtB3X0nJg68CQEu
Content-Type: application/x-perl
Content-Disposition: attachment; filename="forjeremy.pl"
Content-Transfer-Encoding: quoted-printable
#!/usr/pkg/bin/perl=0A=0A# forjeremy.pl, 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
--sdtB3X0nJg68CQEu--
--i9LlY+UWpKt15+FH
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)
iD8DBQFHdsCU0rM/yChQIPgRAi9nAJ9N8UtcHTL9XmfjzCnrMMbEr9nTtgCfTOwu
q9kpqpb9laYzOCKrfpGBY2U=
=2QFp
-----END PGP SIGNATURE-----
--i9LlY+UWpKt15+FH--