debian/0000755000000000000000000000000012164137124007167 5ustar debian/copyright0000644000000000000000000001546012164130146011125 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: pdftk Upstream-Contact: Sid Steward with "pdftk" in the subject. Source: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ Files: * Copyright: 2003-2013, Sid Steward License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . On Debian systems, the complete text of the GNU General Public License version 2 can be found in /usr/share/common-licenses/GPL-2 file. Files: java/com/* Copyright: 1999-2005, Bruno Lowagie 2002, Jeremy Bowman . 2002, Josselin PUJO 2002, Mark Thompson 2003, Galo Gimenez 2004, Oren Manor 2004, Takenori 2004, Ygal Blum 2000-2005, Paulo Soares License: LGPL-2+ or MPL-1.1 The Original Code is 'iText, a free JAVA-PDF library'. . This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. . On Debian systems, the complete text of the GNU General Public License version 2 can be found in /usr/share/common-licenses/LGPL-2. Files: java/com/lowagie/text/pdf/TIFFLZWDecoder.java Copyright: The Apache Software Foundation License: Apache-2.0 Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. . On Debian systems, the complete text of the GNU General Public License version 2 can be found in /usr/share/common-licenses/Apache-2.0 file. Files: java/java/* Copyright: 1999-2003, Free Software Foundation, Inc. License: GPL-2+ with link exception GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version . GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. . As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. . On Debian systems, the complete text of the GNU General Public License version 2 can be found in /usr/share/common-licenses/GPL-2 file. Files: java/com/lowagie/text/pdf/fonts/*.afm java/com/lowagie/text/pdf/fonts/License-Adobe.txt Copyright: 1985-1997, Adobe Systems Incorporated License: other This file and the 14 PostScript(R) AFM files it accompanies may be used, copied, and distributed for any purpose and without charge, with or without modification, provided that all copyright notices are retained; that the AFM files are not distributed without this file; that all modifications to this file or any of the AFM files are prominently noted in the modified file(s); and that this paragraph is not modified. Adobe Systems has no responsibility or obligation to support the use of the AFM files. Files: java/pdftk/org/bouncycastle/* Copyright: 2000-2008, The Legion Of The Bouncy Castle (http://www.bouncycastle.org) License: other The Bouncy Castle License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Files: debian/* Copyright: 2004-2006 Aurelien Jarno 2006-2008 Aurélien GÉRÔME 2009-2013 Johann Felix Soden License: GPL The Debian packaging information is under the GPL. On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. debian/source/0000755000000000000000000000000012161405356010471 5ustar debian/source/format0000644000000000000000000000001412157702724011703 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000003372412164136613011054 0ustar pdftk (2.01-1) unstable; urgency=low * New upstream version - supports AES encryption. (Closes: #703591) - crashes with some pdf 1.6 and 1.7 documents solved. (Closes: #706075, #714518) * debian/patches/*: Drop upstream applied patches and rework the rest. * Build with gcj/g++-4.8 instead of -4.7. * Switch to debhelper compat v9. * debian/copyright: Update years and paths. * debian/control: Use anonscm.debian.org in VCS-* fields; Vcs-Git without experimental branch. * Fix hyphens in man page. -- Johann Felix Soden Mon, 01 Jul 2013 00:19:19 +0200 pdftk (1.45-1) experimental; urgency=low * New upstream version. (Closes: #697642) * Adapt patches to new upstream version and drop fix_infinite_loop_on_lf_eol (solved differently by upstream). * Use gcj/g++-4.7 instead of -4.6. * Bump Standards-Version to 3.9.4 and add experimental branch to Vcs-Git. -- Johann Felix Soden Sun, 03 Feb 2013 19:26:02 +0100 pdftk (1.44-7) unstable; urgency=low * Add patch to solve failures with particular PDF 1.5 documents generated e.g. by newer pdflatex versions: Do not fail if an ObjStm ends with a number. (Closes: #687669) Thanks to Robin Houston . -- Johann Felix Soden Tue, 08 Jan 2013 00:36:58 +0100 pdftk (1.44-6) unstable; urgency=medium * Fix burst command. It produced non-standard-conform pdf files whose unused xref entries were wrongly marked as used. (Closes: #685983) * debian/*: Change my e-mail address and remove DM upload rights. -- Johann Felix Soden Mon, 03 Sep 2012 01:17:35 +0200 pdftk (1.44-5) unstable; urgency=medium * Add patches to fix - infinite loop with non-standard-conform pdf files. - NullPointerException on some pdf files. Thanks to Robin Houston . (side-effect: Closes: #650628) * Overwrite additionally LC_ALL and LC_MESSAGES to circumvent libgcj problems with de_AT.UTF-8. * debian/copyright: Use copyright-format/1.0 and update years. * Bump Standards-Version to 3.9.2. -- Johann Felix Soden Thu, 23 Feb 2012 23:48:48 +0100 pdftk (1.44-4) unstable; urgency=low * Warn instead of fail processing a DRM protected pdf file if there is no owner password supplied. (Closes: #531529) * Support dpkg-buildflags, update patches/customise_build_parameters. * Switch to debhelper compat v8 * debian/copyright: Update to latest DEP5 format and update years. -- Johann Felix Soden Sun, 25 Sep 2011 19:46:52 +0200 pdftk (1.44-3) unstable; urgency=low * Upload to unstable. * Build-Depend (temporary) on gcj-jdk/g++ 4.6 to fix FTBFS. (Closes: #624778) * debian/{control,rules}: Remove (now unneeded) dependency on libgcj-bc. * Remove dependency on libbcprov-java again since ClassNotFoundException is just produced by removed but not purged java security packages. * Bump Standards-Version to 3.9.2. * Merge 1.41+dfsg-10 and 1.41+dfsg-11: - Support PROMPT for user_pw and owner_pw simultaneously. (Closes: #614071) -- Johann Felix Soden Sat, 14 May 2011 01:00:57 +0200 pdftk (1.44-2) experimental; urgency=low * debian/control: - Re-add dependency on libbcprov-java. (Closes: #610394) - Build-depend on gcj-jdk instead of transitional gcj. (Closes: #606906) -- Johann Felix Soden Tue, 18 Jan 2011 23:29:34 +0100 pdftk (1.44-1) experimental; urgency=low * New upstream version. (Closes: #600791) * debian/NEWS: Add notice about the new *_utf8 operations. * Upstream has DFSG-cleaned the bundled itext-paulo library. - debian/{control,rules}: Switch back to usage of bundled libraries. + This fix a problem with generate_fdf. (Closes: #588074) - Repacking is not needed anymore. Change debian/watch accordingly. * debian/patches/*: Drop all patches that are now applied by upstream or adapts pdftk to itext 2.1.7. * debian/copyright: Add copyright information of the bundled libraries and update copyright years. * debian/patches/customise_build_parameters replaces the old build_with_gcc-4.3 patch. * Update debian/(control,copyright,watch) to new upstream homepage. * Install the now with upstream coming man page and changelog. -- Johann Felix Soden Sat, 30 Oct 2010 23:30:30 +0200 pdftk (1.41+dfsg-11) unstable; urgency=low * Support PROMPT for user_pw and owner_pw simultaneously. (Closes: #614071) * Backport from 1.43: Support filenames starting with the keywords 'odd', 'even', 'end'. (Closes: #609471) -- Johann Felix Soden Sat, 19 Feb 2011 23:19:50 +0100 pdftk (1.41+dfsg-10) unstable; urgency=high * Do not create a random owner password if only user password should be set. (Closes: #607018) -- Johann Felix Soden Tue, 14 Dec 2010 20:36:20 +0100 pdftk (1.41+dfsg-9) unstable; urgency=low * Fix pdf compression support: Uncompressed files can now be compressed. * Bump Standards-Version to 3.9.1. -- Johann Felix Soden Sun, 08 Aug 2010 11:24:11 +0200 pdftk (1.41+dfsg-8) unstable; urgency=low * Improve error handling on non-standard conform pdf files. * Use error reporting via non-zero exit code for all errors. (Closes: #577849) * Bump Standards-Version to 3.8.4. -- Johann Felix Soden Thu, 15 Apr 2010 16:03:42 +0200 pdftk (1.41+dfsg-7) unstable; urgency=low * Improve utf8-encoded attachment filename support (fixes crash on unpack_files) (Closes: #462756, #563330) -- Johann Felix Soden Wed, 27 Jan 2010 20:08:45 +0100 pdftk (1.41+dfsg-6) unstable; urgency=low * Add patch to circumvent libgcj10 exception with de_AT.UTF-8 locale. (Closes: #560594) * Conform patch descriptions to DEP3. * debian/rules: fail with error message if itext-*.so is missing. -- Johann Felix Soden Sun, 13 Dec 2009 17:41:56 +0100 pdftk (1.41+dfsg-5) unstable; urgency=low * debian/{rules,control}: - Support clean target in unpatched source dir. - Depend on proper main version of libgcj-bc. * Call g++/gcj with "-g" to improve usefulness of DEB_BUILD_OPTIONS=nostrip. -- Johann Felix Soden Thu, 10 Dec 2009 18:56:12 +0100 pdftk (1.41+dfsg-4) unstable; urgency=low * To solve a fill_form bug, insert itext.jar path into classpath. * Convert package to the 3.0 (quilt) source format. * Improve get-orig-source target: - debian/rules: support any working directory in get-orig-source. - debian/uscan-dfsg-clean.sh: do not add .orig to the main directory in .orig.tar.gz. -- Johann Felix Soden Sun, 29 Nov 2009 13:17:30 +0100 pdftk (1.41+dfsg-3) unstable; urgency=low * Add multistamp and multibackground support (Closes: #511415) - thanks to Bernhard R. Link for the patch. * Extend uncompression: Don't fail when for libitext unknown filters occur. (Closes: #550367) -- Johann Felix Soden Fri, 09 Oct 2009 22:48:13 +0200 pdftk (1.41+dfsg-2) unstable; urgency=low * Fix FTBFS on hppa: - debian/rules: enforce same version for gcj and g++. - debian/control: add g++-4.4 [hppa] to Build-Depends field. * debian/rules: add missing space in clean rule. * Fix failing on pdf files with owner password: - change pdftk-use-internal-itext and support_utf8_filenames in debian/patches and refresh other patches * Add uncompression support which was removed in 1.41+dfsg-1. (Closes: #547910) -- Johann Felix Soden Fri, 25 Sep 2009 11:54:04 +0200 pdftk (1.41+dfsg-1) unstable; urgency=low * Adopted the package with agreement of the previous maintainer - Thanks for your work Aurélien GÉRÔME! * DFSG-repack and use extern libitext-java (Closes: #519466) * Support newer gcj (Closes: #470215, #514561, #534080, #533795, #538252) * Handle utf8 filenames (Closes: #258377, #504014, #504128) * Handle utf8-data, CreationDate and ModDate fields in update_info correctly (Closes: #424920, #461169) * Rework build system - minimize dh rules - update dependencies * Bump Standards-Version to 3.8.3. * Update debian/watch and use created debian/uscan-dfsg-clean.sh * Clean debian/copyright from itext, use machine-readable format - upstream uses GPL-2+ (not unversioned GPL) * Add patch: use mkstemp instead of tmpnam * Add upstream changelog * Remove meaningless "useful" from short description and author-field from long description -- Johann Felix Soden Sat, 05 Sep 2009 15:14:40 +0200 pdftk (1.41-3) unstable; urgency=high * Change my email address in the Uploaders field. * Bump Standards-Version to 3.7.3. * Remove no longer used Vcs-Git, Vcs-Browser, and XS-DM-Upload-Allowed fields. * Change Build-Depends field: gcj-4.2 [!alpha !arm !hppa !hurd-i386]. (Closes: #477898) -- Aurélien GÉRÔME Fri, 30 May 2008 15:08:46 +0200 pdftk (1.41-2) unstable; urgency=low * Switch from the XS-Vcs-Git/XS-Vcs-Browser fields to the Vcs-Git/Vcs-Browser fields and fix typos in both URLs. * Rework debian/copyright to include missing copyright holders and licenses. * Add the XS-DM-Upload-Allowed field. -- Aurélien GÉRÔME Sun, 02 Dec 2007 00:02:04 +0100 pdftk (1.41-1) unstable; urgency=high * New upstream release. (Closes: #400920) * Regenerate upstream tarball by removing superfluous files. + debian/ + java_libs/com/lowagie/text/pdf/PRStream.java.orig + java_libs/com/lowagie/text/pdf/PRTokeniser.java.orig * Add quilt support. * Add the XS-Vcs-Git and XS-Vcs-Browser fields. * Remove the uppercase at the beginning of the Description field. * Fix upstream homepage location. (Closes: #420973) + Remove it from the long description. + Add it in the new Homepage field. * Remove ${misc:Depends} from the Depends field. * Fix FTBFS due to new behaviour of gcjh since gcj-4.1.2. (Closes: #421341, #443714) * Fix ABI mismatch at runtime due to old embedded copies of gcj Java source code. (Closes: #426314) The following directories are thus no longer needed by Debian. + java_libs/gnu/ + java_libs/gnu_local/ + java_libs/java_local/ * Change Build-Depends to gcj-4.2 and g++-4.2. + Depends on libgcj8-1. (Closes: #385914, #423417) * Fix lintian warnings "debian-rules-ignores-make-clean-error". * Remove unused debhelper tools from debian/rules. * Update debian/copyright. -- Aurélien GÉRÔME Wed, 14 Nov 2007 14:40:12 +0100 pdftk (1.40-2) unstable; urgency=low * New maintainer. * Add debian/watch file. -- Aurélien GÉRÔME Sun, 15 Oct 2006 17:14:13 +0200 pdftk (1.40-1) unstable; urgency=low * New upstream version. - Fix concatenation of 2 pdf documents which some kind of pdf (closes: bug#385598). -- Aurelien Jarno Fri, 22 Sep 2006 16:39:10 +0200 pdftk (1.12-11) unstable; urgency=low * Mixing different versions of g++ and gcj does not work, explicitely use gcj-4.1 and g++-4.1. -- Aurelien Jarno Sat, 20 May 2006 00:40:04 +0200 pdftk (1.12-10) unstable; urgency=low * Added -O2 to GCJFLAGS (closes: bug#366661). * Bumped Standards-Version to 3.7.2 (no changes). -- Aurelien Jarno Wed, 10 May 2006 10:56:37 +0200 pdftk (1.12-9) unstable; urgency=low * Fix previous FDF patch (closes: bug#365084). -- Aurelien Jarno Thu, 27 Apr 2006 23:27:01 +0200 pdftk (1.12-8) unstable; urgency=low * Added a patch to support page rotating. Thanks to David Fabel. * Bumped Standards-Version to 3.6.2 (no changes). -- Aurelien Jarno Mon, 24 Apr 2006 22:03:59 +0200 pdftk (1.12-7) unstable; urgency=low * Build with -fdollars-in-identifiers to workaround a gcc bug on arm (closes: bug#334642). -- Aurelien Jarno Wed, 19 Oct 2005 19:31:00 +0200 pdftk (1.12-6) unstable; urgency=low * Fixed FTBFS. -- Aurelien Jarno Sun, 16 Oct 2005 21:21:49 +0200 pdftk (1.12-5) unstable; urgency=low * C++ ABI transition. -- Aurelien Jarno Wed, 6 Jul 2005 01:03:57 +0200 pdftk (1.12-4) unstable; urgency=low * Suggests: xpdf-utils (closes: bug#306625). -- Aurelien Jarno Sun, 1 May 2005 11:27:28 +0200 pdftk (1.12-3) unstable; urgency=low * Depends on libgcj-dev instead of libgcj4-dev. * Build with gcj instead of gcj-3.3. -- Aurelien Jarno Wed, 30 Mar 2005 16:44:02 +0200 pdftk (1.12-2) unstable; urgency=low * Added a patch from Bernhard R. Link to adds a new generate_fdf action to generate a FDF out of a PDF file. The patch will also be added in the next upstream version (closes: bug#289846). -- Aurelien Jarno Tue, 11 Jan 2005 23:22:59 +0100 pdftk (1.12-1) unstable; urgency=low * New upstream release. -- Aurelien Jarno Wed, 10 Nov 2004 21:04:25 +0000 pdftk (1.11-1) unstable; urgency=low * New upstream version. -- Aurelien Jarno Fri, 5 Nov 2004 09:42:53 +0000 pdftk (1.10-1) unstable; urgency=low * New upstream version. -- Aurelien Jarno Wed, 27 Oct 2004 14:15:40 +0000 pdftk (1.00-1) unstable; urgency=low * New upstream version. -- Aurelien Jarno Sat, 14 Aug 2004 20:18:35 +0200 pdftk (0.94-1) unstable; urgency=low * New upstream version. -- Aurelien Jarno Thu, 25 Mar 2004 08:58:03 +0100 pdftk (0.93-1) unstable; urgency=low * New upstream release. * Updated debian/copyright. -- Aurelien Jarno Wed, 10 Mar 2004 07:37:12 +0100 pdftk (0.92-2) unstable; urgency=low * Fixed a typo in the description (closes: bug#234675). -- Aurelien Jarno Wed, 25 Feb 2004 20:21:12 +0100 pdftk (0.92-1) unstable; urgency=low * Initial Release (closes: bug#232863). -- Aurelien Jarno Sun, 15 Feb 2004 23:54:35 +0100 debian/watch0000644000000000000000000000021712157702724010226 0ustar version=3 http://www.pdflabs.com/docs/pdftk-version-history/ \ http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-(.*)-src\.zip \ debian debian/patches/0000755000000000000000000000000012164136466010626 5ustar debian/patches/fix_infinite_loop_on_lf_eol0000644000000000000000000000343012157702724016267 0ustar Description: This patch fixes an infinite loop caused by CR instead of CRLF line endings in non-standard-conform pdf files. Author: Robin Houston Bug-GitHub: https://github.com/robinhouston/pdftk/issues/1 https://github.com/sebbacon/alaveteli/issues/305 Origin: https://github.com/robinhouston/pdftk/commit/05d6aeae83c305d5c7c7fab230722880399391a6 --- a/java/com/lowagie/text/pdf/PdfReader.java +++ b/java/com/lowagie/text/pdf/PdfReader.java @@ -1421,18 +1421,18 @@ // ssteward - 6/21/10 // stream should be followed by a LF or a CRLF, but not just a CR, per the PDF spec. // however, I have encountered a generated PDF (Microsoft Reporting Services 10.0.0.0) - // that added a space after "stream" but before the CR; so gobble up unexpected chars - // until we find a LF + // that added a space after "stream" but before the CR; and also one (HP Digital + // Sending Device) that follows the stream with just a CR, so handle these cases too. int ch = tokens.read(); - /* - if (ch != '\n') + if (ch == ' ') ch = tokens.read(); - if (ch != '\n') - tokens.backOnePosition(ch); - */ - // ssteward - while (ch != '\n') - ch = tokens.read(); + if (ch == '\r') { + ch = tokens.read(); + if (ch != '\n') + tokens.backOnePosition(ch); + } + if (ch == -1) + tokens.throwError("Unexpected end of file"); PRStream stream = new PRStream(this, tokens.getFilePointer()); stream.putAll(dic); debian/patches/fix_hyphen_pdftk.1_man0000644000000000000000000003316612164136466015105 0ustar Description: Fix hyphens in the man file. For more information, see http://lintian.debian.org/tags/hyphen-used-as-minus-sign.html . Author: Johann Felix Soden --- a/pdftk.1 +++ b/pdftk.1 @@ -19,13 +19,13 @@ .SH NAME pdftk \- A handy tool for manipulating PDF .SH SYNOPSIS -\fBpdftk\fR \fI\fR +\fBpdftk\fR \fI\fR .br [ \fBinput_pw\fR \fI\fR ] .br [ \fI\fR \fI\fR ] .br - [ \fBoutput\fR \fI\fR ] + [ \fBoutput\fR \fI\fR ] .br [ \fBencrypt_40bit\fR | \fBencrypt_128bit\fR ] .br @@ -66,7 +66,7 @@ \fBattach_files\fR | \fBunpack_files\fR ] .br -For Complete Help: \fBpdftk --help\fR +For Complete Help: \fBpdftk \-\-help\fR .br .SH DESCRIPTION If PDF is electronic paper, then pdftk is an electronic staple-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a simple tool for doing everyday things with PDF documents. Use it to: @@ -107,9 +107,9 @@ \fB\-\-help\fR, \fB\-h\fR Show this summary of options. .TP -.B +.B A list of the input PDF files. If you plan to combine these PDFs (without -using handles) then list files in the order you want them combined. Use \fB-\fR +using handles) then list files in the order you want them combined. Use \fB\-\fR to pass a single PDF into pdftk via stdin. Input files can be associated with handles, where a handle is one or more upper-case letters: @@ -153,7 +153,7 @@ .B cat [] Assembles (catenates) pages from input PDFs to create a new PDF. Use \fBcat\fR to merge PDF pages or to split PDF pages from documents. You can also use it to rotate PDF pages. Page order in the new PDF is specified by the order of the given page ranges. Page ranges are described like this: -\fI\fR[\fI\fR[\fB-\fR\fI\fR[\fI\fR]]][\fI\fR] +\fI\fR[\fI\fR[\fB\-\fR\fI\fR[\fI\fR]]][\fI\fR] Where the handle identifies one of the input PDF files, and the beginning and ending page numbers are one-based references @@ -164,11 +164,11 @@ If the handle is omitted from the page range, then the pages are taken from the first input PDF. -The \fBeven\fR qualifier causes pdftk to use only the even-numbered PDF pages, so \fB1-6even\fR yields pages 2, 4 and 6 in that order. \fB6-1even\fR yields pages 6, 4 and 2 in that order. +The \fBeven\fR qualifier causes pdftk to use only the even-numbered PDF pages, so \fB1\-6even\fR yields pages 2, 4 and 6 in that order. \fB6\-1even\fR yields pages 6, 4 and 2 in that order. The \fBodd\fR qualifier works similarly to the \fBeven\fR. -The page rotation setting can cause pdftk to rotate pages and documents. Each option sets the page rotation as follows (in degrees): \fBnorth\fR: 0, \fBeast\fR: 90, \fBsouth\fR: 180, \fBwest\fR: 270, \fBleft\fR: -90, \fBright\fR: +90, \fBdown\fR: +180. \fBleft\fR, \fBright\fR, and \fBdown\fR make relative adjustments to a page's rotation. +The page rotation setting can cause pdftk to rotate pages and documents. Each option sets the page rotation as follows (in degrees): \fBnorth\fR: 0, \fBeast\fR: 90, \fBsouth\fR: 180, \fBwest\fR: 270, \fBleft\fR: \-90, \fBright\fR: +90, \fBdown\fR: +180. \fBleft\fR, \fBright\fR, and \fBdown\fR make relative adjustments to a page's rotation. If no arguments are passed to cat, then pdftk combines all input PDFs in the order they were given to create the output. @@ -181,43 +181,43 @@ .br * Reference a single page by omitting the ending page number. .br -* The handle may be used alone to represent the entire PDF document, e.g., B1-end is the same as B. +* The handle may be used alone to represent the entire PDF document, e.g., B1\-end is the same as B. .br -* You can reference page numbers in reverse order by prefixing them with the letter \fBr\fR. For example, page r1 is the last page of the document, r2 is the next-to-last page of the document, and rend is the first page of the document. You can use this prefix in ranges, too, for example r3-r1 is the last three pages of a PDF. +* You can reference page numbers in reverse order by prefixing them with the letter \fBr\fR. For example, page r1 is the last page of the document, r2 is the next-to-last page of the document, and rend is the first page of the document. You can use this prefix in ranges, too, for example r3\-r1 is the last three pages of a PDF. .B Page Range Examples without Handles: .br -\fB1-endeast\fR - rotate entire document 90 degrees +\fB1\-endeast\fR \- rotate entire document 90 degrees .br -\fB5 11 20\fR - take single pages from input PDF +\fB5 11 20\fR \- take single pages from input PDF .br -\fB5-25oddwest\fR - take odd pages in range, rotate 90 degrees +\fB5\-25oddwest\fR \- take odd pages in range, rotate 90 degrees .br -\fB6-1\fR - reverse pages in range from input PDF +\fB6\-1\fR \- reverse pages in range from input PDF .B Page Range Examples Using Handles: .br Say \fBA=in1.pdf B=in2.pdf\fR, then: .br -\fBA1-21\fR - take range from in1.pdf +\fBA1\-21\fR \- take range from in1.pdf .br -\fBBend-1odd\fR - take all odd pages from in2.pdf in reverse order +\fBBend\-1odd\fR \- take all odd pages from in2.pdf in reverse order .br -\fBA72\fR - take a single page from in1.pdf +\fBA72\fR \- take a single page from in1.pdf .br -\fBA1-21 Beven A72\fR - assemble pages from both in1.pdf and in2.pdf +\fBA1\-21 Beven A72\fR \- assemble pages from both in1.pdf and in2.pdf .br -\fBAwest\fR - rotate entire in1.pdf document 90 degrees +\fBAwest\fR \- rotate entire in1.pdf document 90 degrees .br -\fBB\fR - use all of in2.pdf +\fBB\fR \- use all of in2.pdf .br -\fBA2-30evenleft\fR - take the even pages from the range, remove 90 degrees from each page's rotation +\fBA2\-30evenleft\fR \- take the even pages from the range, remove 90 degrees from each page's rotation .br -\fBA A\fR - catenate in1.pdf with in1.pdf +\fBA A\fR \- catenate in1.pdf with in1.pdf .br -\fBAevenwest Aoddeast\fR - apply rotations to even pages, odd pages from in1.pdf +\fBAevenwest Aoddeast\fR \- apply rotations to even pages, odd pages from in1.pdf .br -\fBAwest Bwest Bdown\fR - catenate rotated documents +\fBAwest Bwest Bdown\fR \- catenate rotated documents .TP .B shuffle [] Collates pages from input PDFs to create a new PDF. Works like the \fBcat\fR operation except that it takes one page at a time from each page range to assemble the output PDF. If one range runs out of pages, it continues with the remaining ranges. Ranges can use all of the features described above for \fBcat\fR, like reverse page ranges, multiple ranges from a single PDF, and page rotation. This feature was designed to help collate PDF pages after scanning paper documents. @@ -236,11 +236,11 @@ .B rotate [] Takes a single input PDF and rotates just the specified pages. All other pages remain unchanged. The page order remains unchaged. Specify the pages to rotate using the same notation as you would with \fBcat\fR, except you omit the pages that you aren't rotating: -[\fI\fR[\fB-\fR\fI\fR[\fI\fR]]][\fI\fR] +[\fI\fR[\fB\-\fR\fI\fR[\fI\fR]]][\fI\fR] The qualifier can be \fBeven\fR or \fBodd\fR, and the page rotation can be \fBnorth\fR, \fBsouth\fR, \fBeast\fR, \fBwest\fR, \fBleft\fR, \fBright\fR, or \fBdown\fR. -Each option sets the page rotation as follows (in degrees): \fBnorth\fR: 0, \fBeast\fR: 90, \fBsouth\fR: 180, \fBwest\fR: 270, \fBleft\fR: -90, \fBright\fR: +90, \fBdown\fR: +180. \fBleft\fR, \fBright\fR, and \fBdown\fR make relative adjustments to a page's rotation. +Each option sets the page rotation as follows (in degrees): \fBnorth\fR: 0, \fBeast\fR: 90, \fBsouth\fR: 180, \fBwest\fR: 270, \fBleft\fR: \-90, \fBright\fR: +90, \fBdown\fR: +180. \fBleft\fR, \fBright\fR, and \fBdown\fR make relative adjustments to a page's rotation. The given order of the pages doesn't change the page order in the output. .TP @@ -249,9 +249,9 @@ out of it to the given output filename or (if no output is given) to stdout. Does not create a new PDF. .TP -.B fill_form +.B fill_form Fills the single input PDF's form fields with the data from an FDF file, XFDF file or stdin. Enter the data filename -after \fBfill_form\fR, or use \fB-\fR to pass the data via stdin, like so: +after \fBfill_form\fR, or use \fB\-\fR to pass the data via stdin, like so: pdftk form.pdf fill_form data.fdf output form.filled.pdf @@ -265,25 +265,25 @@ Also see the \fBflatten\fR and \fBneed_appearances\fR options. .TP -.B background +.B background Applies a PDF watermark to the background of a single input PDF. Pass the background PDF's filename after \fBbackground\fR like so: pdftk in.pdf background back.pdf output out.pdf Pdftk uses only the first page from the background PDF and applies it to every page of the -input PDF. This page is scaled and rotated as needed to fit the input page. You can use \fB-\fR +input PDF. This page is scaled and rotated as needed to fit the input page. You can use \fB\-\fR to pass a background PDF into pdftk via stdin. -If the input PDF does not have a transparent background (such as a PDF created from page scans) then the resulting background won't be visible -- use the \fBstamp\fR operation instead. +If the input PDF does not have a transparent background (such as a PDF created from page scans) then the resulting background won't be visible \- use the \fBstamp\fR operation instead. .TP -.B multibackground +.B multibackground Same as the \fBbackground\fR operation, but applies each page of the background PDF to the corresponding page of the input PDF. If the input PDF has more pages than the stamp PDF, then the final stamp page is repeated across these remaining pages in the input PDF. .TP -.B stamp +.B stamp This behaves just like the \fBbackground\fR operation except it overlays the stamp PDF page \fIon top\fR of the input PDF document's pages. This works best if the stamp PDF page has a transparent background. .TP -.B multistamp +.B multistamp Same as the \fBstamp\fR operation, but applies each page of the background PDF to the corresponding page of the input PDF. If the input PDF has more pages than the stamp PDF, then the final stamp page is repeated across these remaining pages in the input PDF. .TP .B dump_data @@ -306,7 +306,7 @@ filename or (if no output is given) to stdout. Non-ASCII characters are encoded as XML numerical entities. Does not create a new PDF. .TP -.B update_info +.B update_info Changes the bookmarks and metadata in a single PDF's Info dictionary to match the input data file. The input data file uses the same syntax as the output from \fBdump_data\fR. Non-ASCII characters should be encoded as XML @@ -315,7 +315,7 @@ pdftk in.pdf update_info in.info output out.pdf .TP -.B update_info_utf8 +.B update_info_utf8 Same as \fBupdate_info\fR except that the input is encoded as UTF-8. .TP .B attach_files [to_page ] @@ -338,9 +338,9 @@ pdftk report.pdf unpack_files output PROMPT .RE .TP -.B [output ] +.B [output ] The output PDF filename may not be set to the name of an input filename. Use -\fB-\fR to output to stdout. +\fB\-\fR to output to stdout. When using the \fBdump_data\fR operation, use \fBoutput\fR to set the name of the output data file. When using the \fBunpack_files\fR operation, use \fBoutput\fR to set the name of an output directory. When using the \fBburst\fR operation, you can use \fBoutput\fR @@ -430,7 +430,7 @@ .br or if odd.pdf is in reverse order: .br -pdftk A=even.pdf B=odd.pdf shuffle A Bend-1 output collated.pdf +pdftk A=even.pdf B=odd.pdf shuffle A Bend\-1 output collated.pdf .TP .B Decrypt a PDF pdftk secured.pdf input_pw foopass output unsecured.pdf @@ -456,11 +456,11 @@ pdftk *.pdf cat output combined.pdf .TP .B Remove page 13 from in1.pdf to create out1.pdf -pdftk in.pdf cat 1-12 14-end output out1.pdf +pdftk in.pdf cat 1\-12 14\-end output out1.pdf .br or: .br -pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf +pdftk A=in1.pdf cat A1\-12 A14\-end output out1.pdf .TP .B Apply 40-bit encryption to output, revoking all permissions (the default). Set the owner PW to 'foopass'. pdftk 1.pdf 2.pdf cat output 3.pdf encrypt_40bit owner_pw foopass @@ -484,14 +484,14 @@ pdftk in.pdf dump_data output report.txt .TP .B Rotate the first PDF page to 90 degrees clockwise -pdftk in.pdf cat 1east 2-end output out.pdf +pdftk in.pdf cat 1east 2\-end output out.pdf .TP .B Rotate an entire PDF document to 180 degrees -pdftk in.pdf cat 1-endsouth output out.pdf +pdftk in.pdf cat 1\-endsouth output out.pdf .SH NOTES The pdftk home page permalink is: .br -http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ +http://www.pdflabs.com/tools/pdftk\-the\-pdf\-toolkit/ .br The easy-to-remember shortcut is: www.pdftk.com .SH AUTHOR debian/patches/overwrite_more_lc_environ_variables0000644000000000000000000000136212157706001020057 0ustar Description: Set additionally LC_MESSAGES=C and LC_ALL=C to circumvent libgcj10 exception with locale de_AT.UTF-8. This patch is a workaround to an ArrayIndexOutOfBoundsException evoked in java.text.SimpleDateFormat.formatWithAttribute (libgcj10, Version 4.4.2-4). The exception occures only between April and December and with the de_AT-UTF.8 locale. Author: Johann Felix Soden Bug-Debian: http://bugs.debian.org/560594 --- a/pdftk/pdftk.cc +++ b/pdftk/pdftk.cc @@ -3650,6 +3650,11 @@ */ static char my_lang[]="LANG=C"; putenv(my_lang); + static char my_lc_messages[]="LC_MESSAGES=C"; + putenv(my_lc_messages); + static char my_lc_all[]="LC_ALL=C"; + putenv(my_lc_all); + for( int ii= 1; ii< argc; ++ii ) { version_b= debian/patches/drm_fix0000644000000000000000000000447212157705770012212 0ustar Description: Warn instead of fail if no owner password is given. Author: James Y Knight , Johann Felix Soden Bug-Debian: http://bugs.debian.org/531529 --- a/pdftk/pdftk.cc +++ b/pdftk/pdftk.cc @@ -242,7 +242,15 @@ // store in this java object so the gc can trace it g_dont_collect_p->addElement( reader ); - input_pdf_p->m_authorized_b= ( !reader->encrypted || reader->ownerPasswordUsed ); + input_pdf_p->m_authorized_b= true; // instead of: ( !reader->encrypted || reader->ownerPasswordUsed ); + if ( open_success_b && reader->encrypted && !reader->ownerPasswordUsed ) + { + cerr << "WARNING: The creator of the input PDF:" << endl; + cerr << " " << input_pdf_p->m_filename << endl; + cerr << " has set an owner password (which is not required to handle this PDF)." << endl; + cerr << " You did not supply this password. Please respect any copyright." << endl; + } + if( !input_pdf_p->m_authorized_b ) { open_success_b= false; } @@ -272,9 +280,8 @@ cerr << "The password you supplied for the input PDF:" << endl; cerr << " " << input_pdf_p->m_filename << endl; cerr << " did not work. This PDF is encrypted, and you must supply the" << endl; - cerr << " owner password to open it. If it has no owner password, then" << endl; - cerr << " enter the user password, instead. To quit, enter a blank password" << endl; - cerr << " at the next prompt." << endl; + cerr << " owner or the user password to open it. To quit, enter a blank" << endl; + cerr << " password at the next prompt." << endl; prompt_for_password( "open", "the input PDF:\n "+ input_pdf_p->m_filename, input_pdf_p->m_password ); if( !input_pdf_p->m_password.empty() ) { // reset flags try again @@ -288,7 +295,7 @@ cerr << "Error: Failed to open PDF file: " << endl; cerr << " " << input_pdf_p->m_filename << endl; if( !input_pdf_p->m_authorized_b ) { - cerr << " OWNER PASSWORD REQUIRED, but not given (or incorrect)" << endl; + cerr << " OWNER OR USER PASSWORD REQUIRED, but not given (or incorrect)" << endl; } } @@ -665,7 +672,7 @@ } if( !it->m_authorized_b ) { - cout << ", OWNER PASSWORD REQUIRED, but not given (or incorrect)"; + cout << ", OWNER OR USER PASSWORD REQUIRED, but not given (or incorrect)"; } cout << endl; debian/patches/series0000644000000000000000000000013612164136466012043 0ustar customise_build_parameters drm_fix overwrite_more_lc_environ_variables fix_hyphen_pdftk.1_man debian/patches/customise_build_parameters0000644000000000000000000000306512157705331016165 0ustar Description: Change compiler parameters for Debian Author: Johann Felix Soden --- a/pdftk/Makefile.Debian +++ b/pdftk/Makefile.Debian @@ -21,7 +21,7 @@ # tools # need direct path to libgcj for gcjh (starting in gcj 4.1.2 per Aurélien GÉRÔME) TOOLPATH= -export VERSUFF=-4.6 +export VERSUFF= export CPP= $(TOOLPATH)cpp$(VERSUFF) export CXX= $(TOOLPATH)g++$(VERSUFF) export GCJ= $(TOOLPATH)gcj$(VERSUFF) @@ -64,13 +64,13 @@ # only effects libraries following option on the command line # # -export CPPFLAGS= -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -DUNBLOCK_SIGNALS -fdollars-in-identifiers -export CXXFLAGS= -Wall -Wextra -Weffc++ -O2 -export GCJFLAGS= -fsource=1.3 -O2 -export GCJHFLAGS= -force +export CPPFLAGS+= -DPATH_DELIM=0x2f -DASK_ABOUT_WARNINGS=false -DUNBLOCK_SIGNALS -fdollars-in-identifiers +export CXXFLAGS+= -Wall -Wextra -Weffc++ -O2 +export GCJFLAGS+= -fsource=1.3 -O2 +export GCJHFLAGS+= -force export LDLIBS= -lgcj include Makefile.Base # required packages (xubuntu 12.04) -# gcj-jdk, g++ \ No newline at end of file +# gcj-jdk, g++ --- a/pdftk/Makefile.Base +++ b/pdftk/Makefile.Base @@ -43,7 +43,7 @@ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -I$(JAVALIBPATH) pdftk.cc -c pdftk : pdftk.o attachments.o report.o $(JAVALIB) $(LIBGCJ_SUPPLEMENT_FULL_O) - $(CXX) $(CXXFLAGS) attachments.o report.o pdftk.o $(JAVALIB) $(LIBGCJ_SUPPLEMENT_FULL_O) $(LDLIBS) -o pdftk + $(CXX) $(LDFLAGS) $(CXXFLAGS) attachments.o report.o pdftk.o $(JAVALIB) $(LIBGCJ_SUPPLEMENT_FULL_O) $(LDLIBS) -o pdftk install: /usr/bin/install pdftk /usr/local/bin debian/compat0000644000000000000000000000000212164130146010362 0ustar 9 debian/NEWS0000644000000000000000000000154612161403014007663 0ustar pdftk (1.45-1) experimental; urgency=low The syntax for page rotation has changed: Instead of N, S, E, W, L, R and D, you need to use: north, south, east, west, left, right and down. -- Johann Felix Soden Tue, 18 Jun 2013 00:50:38 +0200 pdftk (1.44-1) experimental; urgency=low Since the 1.43+dfsg-1 release, the dump_data, dump_data_fields and update_info operations used UTF-8 encoding instead of XML numerical entities for non-ascii characters. Now the old behaviour is restored: The dump_data, dump_data_fields and update_info_utf operations use XML numerical entities again. UTF-8 encoding is now supported by the alternative operations dump_data_utf8, dump_data_fields_utf8 and update_info_utf8. See the pdftk(1) man page for more information. -- Johann Felix Soden Sat, 30 Oct 2010 14:51:42 +0200 debian/rules0000755000000000000000000000202512157702724010254 0ustar #!/usr/bin/make -f # -*- makefile -*- # extract version suffix from gcj # VERSUFF=-$(shell gcj --version | sed -r -e '1s/.* ([0-9]+\.[0-9]+).*/\1/;q') # use (temporary) fixed gcj/g++ version from debian/control VERSUFF=$(shell grep -oP '(?<=gcj)-[0-9.]*' debian/control) DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/buildflags.mk %: dh $@ override_dh_auto_build: dh_auto_build $(MAKE) -C $(CURDIR)/pdftk -f Makefile.Debian VERSUFF=$(VERSUFF) override_dh_auto_clean: # do not call clean target if source is unpatched make -C $(CURDIR)/pdftk -f Makefile.Debian clean rm -rf $(CURDIR)/pdftk/pdftk rm -rf $(CURDIR)/pdftk/*.o find $(CURDIR) -name "*.class" -print0 | xargs --null -t -r rm dh_auto_clean override_dh_auto_install: install -o root -g root -m 755 -d $(CURDIR)/debian/pdftk/usr/bin install -o root -g root -m 755 $(CURDIR)/pdftk/pdftk $(CURDIR)/debian/pdftk/usr/bin dh_auto_install get-orig-source: cd $(dir $(firstword $(MAKEFILE_LIST))).. && \ uscan --force-download --repack --rename --destdir $(CURDIR) debian/manpages0000644000000000000000000000001012157702724010702 0ustar pdftk.1 debian/control0000644000000000000000000000244012164130146010567 0ustar Source: pdftk Section: text Priority: optional Maintainer: Johann Felix Soden Build-Depends: debhelper (>= 9), gcj-4.8-jdk, g++-4.8 Standards-Version: 3.9.4 Homepage: http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ Vcs-Git: git://anonscm.debian.org/collab-maint/pdftk.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/pdftk.git;a=summary Package: pdftk Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: xpdf-utils Description: tool for manipulating PDF documents If PDF is electronic paper, then pdftk is an electronic stapler-remover, hole-punch, binder, secret-decoder-ring, and X-Ray-glasses. Pdftk is a simple tool for doing everyday things with PDF documents. Keep one in the top drawer of your desktop and use it to: - Merge PDF documents - Split PDF pages into a new document - Decrypt input as necessary (password required) - Encrypt output as desired - Fill PDF Forms with FDF Data and/or Flatten Forms - Apply a Background Watermark - Report PDF on metrics, including metadata and bookmarks - Update PDF Metadata - Attach Files to PDF Pages or the PDF Document - Unpack PDF Attachments - Burst a PDF document into single pages - Uncompress and re-compress page streams - Repair corrupted PDF (where possible)