svn commit: r520569 - in head/print: . shrinkpdf shrinkpdf/files
Michael Gmelin
grembo at FreeBSD.org
Sat Dec 21 16:02:36 UTC 2019
Author: grembo
Date: Sat Dec 21 16:02:34 2019
New Revision: 520569
URL: https://svnweb.freebsd.org/changeset/ports/520569
Log:
shrinkpdf is a nifty little tool to reduce the file size of a PDF
Added:
head/print/shrinkpdf/
head/print/shrinkpdf/Makefile (contents, props changed)
head/print/shrinkpdf/distinfo (contents, props changed)
head/print/shrinkpdf/files/
head/print/shrinkpdf/files/shrinkpdf.1.in (contents, props changed)
head/print/shrinkpdf/pkg-descr (contents, props changed)
Modified:
head/print/Makefile
Modified: head/print/Makefile
==============================================================================
--- head/print/Makefile Sat Dec 21 15:35:48 2019 (r520568)
+++ head/print/Makefile Sat Dec 21 16:02:34 2019 (r520569)
@@ -227,6 +227,7 @@
SUBDIR += rubygem-ttfunk
SUBDIR += scribus-devel
SUBDIR += sgf2tex
+ SUBDIR += shrinkpdf
SUBDIR += splix
SUBDIR += system-config-printer
SUBDIR += t1utils
Added: head/print/shrinkpdf/Makefile
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/print/shrinkpdf/Makefile Sat Dec 21 16:02:34 2019 (r520569)
@@ -0,0 +1,41 @@
+# $FreeBSD$
+
+PORTNAME= shrinkpdf
+PORTVERSION= 20191221
+CATEGORIES= print graphics
+MASTER_SITES= http://www.alfredklomp.com/programming/shrinkpdf/
+DISTNAME= ${PORTNAME}.sh
+EXTRACT_SUFX= # none
+EXTRACT_ONLY= # none
+
+MAINTAINER= grembo at FreeBSD.org
+COMMENT= Simple wrapper around Ghostscript to reduce the file size of PDFs
+
+LICENSE= BSD3CLAUSE
+
+USES= ghostscript:run
+SUB_FILES= ${PORTNAME}.1
+
+#RUN_DEPENDS= ${JAVALIBDIR}/bcmail.jar:java/bouncycastle15 \
+# ${JAVALIBDIR}/commons-logging.jar:java/apache-commons-logging \
+# ${JAVALIBDIR}/commons-io.jar:devel/apache-commons-io
+
+NO_BUILD= yes
+NO_ARCH= yes
+
+PLIST_FILES= bin/${PORTNAME} man/man1/${PORTNAME}.1.gz
+
+do-install:
+ ${INSTALL_SCRIPT} ${DISTDIR}/${PORTNAME}.sh \
+ ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+ ${INSTALL_MAN} ${WRKDIR}/shrinkpdf.1 ${STAGEDIR}${MANPREFIX}/man/man1
+
+# @${ECHO_MSG} -n ">> Installing JAR files in ${JAVAJARDIR}..."
+# @${MKDIR} ${STAGEDIR}${JAVAJARDIR}
+#.for f in ${JAR_NAMES}
+# ${INSTALL_DATA} ${DISTDIR}/${f}-${PORTVERSION}.jar \
+# ${STAGEDIR}${JAVAJARDIR}/${f}.jar
+#.endfor
+# @${ECHO_MSG} " [ DONE ]"
+
+.include <bsd.port.mk>
Added: head/print/shrinkpdf/distinfo
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/print/shrinkpdf/distinfo Sat Dec 21 16:02:34 2019 (r520569)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1576932323
+SHA256 (shrinkpdf.sh) = 2aa47759a945165e119b84b99d1042c63fceb1ec2692145e250b4f78ec032662
+SIZE (shrinkpdf.sh) = 3114
Added: head/print/shrinkpdf/files/shrinkpdf.1.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/print/shrinkpdf/files/shrinkpdf.1.in Sat Dec 21 16:02:34 2019 (r520569)
@@ -0,0 +1,79 @@
+.\"
+.\" Copyright (c) 2014-2019 Alfred Klomp
+.\" Copyright (c) 2019 Michael Gmelin
+.\"
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd December 21, 2019
+.Dt SHRINKPDF 1
+.Os
+.Sh NAME
+.Nm shrinkpdf
+.Nd A simple wrapper around Ghostscript to reduce the file size of PDFs
+.Sh SYNOPSIS
+.Nm
+.Ar infile
+.Op outfile
+.Op resolution_in_dpi
+.Sh DESCRIPTION
+Inspired by some code found in an OpenOffice Python script,
+.Nm
+feeds a PDF through Ghostscript, which performs lossy recompression
+by such methods as downsampling the images to a lower resolution.
+The result should be (but not always is) a much smaller file.
+.Pp
+If invoked without
+.Op outfile ,
+the shrunk file is written to standard output.
+If invoked without
+.Op resolution_in_dpi ,
+a default resolution of 72 dpi is used.
+.Pp
+If both
+.Op infile
+and
+.Op outfile
+are regular files, the script checks if the shrunk output file is actually
+smaller than the input file.
+If it is not, it writes a message to stderr and copies the input to output.
+.Sh EXAMPLES
+Reduce PDF resolution to 72 dpi:
+.Dl $ shrinkpdf myfile.pdf >myfile-72dpi.pdf
+.Pp
+Reduce PDF resolution to 300 dpi:
+.Dl $ shrinkpdf myfile.pdf - 300 >myfile-300dpi.pdf
+.Pp
+Reduce PDF resolution to 150 dpi, specify
+.Op outfile :
+.Dl $ shrinkpdf myfile.pdf myfile-150dpi.pdf 150
+.Sh SEE ALSO
+.Xr gs 1
+.Sh AUTHORS
+.An -nosplit
+.Nm
+was written by Alfred Klomp.
+This manual page was written by
+.An Michael Gmelin Aq Mt grembo at FreeBSD.org
+based on content written by Alfred Klomp.
Added: head/print/shrinkpdf/pkg-descr
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/print/shrinkpdf/pkg-descr Sat Dec 21 16:02:34 2019 (r520569)
@@ -0,0 +1,6 @@
+A simple wrapper around Ghostscript to shrink PDFs (as in reduce filesize).
+The script feeds a PDF through Ghostscript, which performs lossy
+recompression by such methods as downsampling the images to 72dpi. The
+result should be (but not always is) a much smaller file.
+
+WWW: http://www.alfredklomp.com/programming/shrinkpdf/
More information about the svn-ports-all
mailing list