summaryrefslogtreecommitdiff
path: root/support/pdflatexpicscale
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/pdflatexpicscale
Initial commit
Diffstat (limited to 'support/pdflatexpicscale')
-rw-r--r--support/pdflatexpicscale/README34
-rw-r--r--support/pdflatexpicscale/pdflatexpicscale.pdfbin0 -> 117642 bytes
-rwxr-xr-xsupport/pdflatexpicscale/pdflatexpicscale.pl258
-rw-r--r--support/pdflatexpicscale/pdflatexpicscale.tex339
-rw-r--r--support/pdflatexpicscale/testprinter.ps211
5 files changed, 842 insertions, 0 deletions
diff --git a/support/pdflatexpicscale/README b/support/pdflatexpicscale/README
new file mode 100644
index 0000000000..56b00b6b36
--- /dev/null
+++ b/support/pdflatexpicscale/README
@@ -0,0 +1,34 @@
+pdflatexpicscale is software to scale pictures down
+to a target resolution before creating a PDF document
+with PdfLaTeX.
+
+*Version*
+2018-02-12 (version of bundle)
+For version details check pdflatexpicscale.pdf.
+
+*Requirements*
+Perl and ImageMagick have to be installed.
+
+*Basic usage*
+pdflatex article
+pdflatexpicscale.pl article
+edit article.tex: insert \graphicspath{{printimg/}}
+pdflatex article
+and you're done.
+
+For more information, please consult pdflatexpicscale.pdf.
+
+*File list*
+README This file
+pdflatexpicscale.pl Tool, perl code
+pdflatexpicscale.pdf Documentation (Installation and usage)
+testprinter.ps Resolution test file for your PostScript printer
+
+*Licensing*
+pdflatexpicscale and the accompanying files are
+subject to the current version of the
+LaTeX project public license (not included).
+
+*Author*
+Peter Willadt
+Email: willadt at t-online.de
diff --git a/support/pdflatexpicscale/pdflatexpicscale.pdf b/support/pdflatexpicscale/pdflatexpicscale.pdf
new file mode 100644
index 0000000000..8e42d2a18f
--- /dev/null
+++ b/support/pdflatexpicscale/pdflatexpicscale.pdf
Binary files differ
diff --git a/support/pdflatexpicscale/pdflatexpicscale.pl b/support/pdflatexpicscale/pdflatexpicscale.pl
new file mode 100755
index 0000000000..ef16ea8639
--- /dev/null
+++ b/support/pdflatexpicscale/pdflatexpicscale.pl
@@ -0,0 +1,258 @@
+#!/usr/bin/perl -w
+# Scale pictures to be included into a LaTeX generated PDF file.
+# written by peter willadt
+# contact: willadt at t-online.de
+# this software is subject to the LaTeX project public license.
+# changes:
+# 2016-07-27 first public release
+# 2016-08-02 changed regex to prevent problem with long filenames
+# 2016-08-02 changed > to gt (shame on me)
+# 2016-10-20 corrected behaviour when program gets called without arguments
+# (shame on me, again)
+# 2016-10-20 added undocumented switch --help to show usage.
+# 2017-01-23 Updated documentation (see pdflatexpicscale.tex),
+# and corrected version number
+# Please note: version numbers will be updated to keep sync
+# with the documentation, even when the perl code does not change.
+# 2017-02-01 pdflatexpicscale did not work correct when log lines were
+# wrapped twice. This is fixed.
+#
+use strict;
+use File::Basename;
+use File::Spec;
+use File::Copy;
+use Getopt::Long;
+
+my $version = '0.32';
+my $versiondate = '2018-02-12'; #version %version
+my $showversion;
+
+my $verbose;
+my $help;
+my $TeXproject;
+
+# folders for scaled graphics, relative names
+my $printfolderprefix = 'printimg';
+my $previewfolderprefix = 'previewimg';
+my $srcfolder = '';
+
+# final resolution. special b/w handling not implemented yet
+my $printdpi = 300;
+my $printbwdpi = 4 * $printdpi;
+my $previewdpi = 72;
+my $tolerance = 20;
+
+# file formats
+my %canhandle =
+( JPG => '1',
+ PNG => '1',
+);
+
+# bookkeeping
+my %processedimages;
+my $copied = 0;
+my $scaled = 0;
+my $skipped = 0;
+
+sub printInplaceError
+{
+ my $filename = shift;
+ print "I will not do inplace modification of graphics:\n" .
+ "($filename) will not be processed. (Missing path?)\n";
+}
+
+sub printMissingError
+{
+ my $filename = shift;
+ print "I can not find ($filename). (What have you done?)\n";
+}
+
+sub handleImage
+{
+ my $filename = shift;
+ my $dstwidth = shift;
+ my $dstheight = shift;
+ my ($srcwidth, $srcheight, $srcdepth);
+ my $dstfilename;
+ my $xfilename;
+ my @xsrcdirs;
+ my @dstdirs;
+ my @convertargs;
+ my $idstring;
+ print "$filename\n";
+ $dstdirs[0] = '.';
+ $dstdirs[1] = $printfolderprefix;
+ $dstfilename = File::Spec->catfile(@dstdirs, basename($filename));
+ if($filename eq $dstfilename){
+ unless ($srcfolder gt ' ') {
+ printInplaceError($filename);
+ $skipped++;
+ return;
+ }
+ $xsrcdirs[0] = $srcfolder;
+ $xfilename = File::Spec->catfile(@xsrcdirs, basename($filename));
+ unless (-e $xfilename){
+ printMissingError($xfilename);
+ $skipped++;
+ return;
+ }
+ $filename = $xfilename;
+ }
+ # check for image width and height
+ $idstring = `identify -format "%w x %h %[depth] " $filename`;
+ return unless $idstring =~ /(\d+) x (\d+) (\d+)/;
+ $srcwidth = $1; $srcheight = $2; $srcdepth = $3;
+ if($srcdepth == 1) { # hires for bw pix
+ $dstwidth = int($dstwidth * $printbwdpi / 72.27 + .5);
+ $dstheight = int($dstheight * $printbwdpi / 72.27 + .5);
+ }else { # moderate res for any other
+ $dstwidth = int($dstwidth * $printdpi / 72.27 + .5);
+ $dstheight = int($dstheight * $printdpi / 72.27 + .5);
+ }
+ if(-e $dstfilename){
+ # if younger and requested size: skip
+ my ($mtime1, $mtime2, $size1, $size2, $idstring2, $existwidth);
+ my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
+ $atime, $ctime, $blksize, $blocks);
+ ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
+ $atime, $mtime1, $ctime, $blksize, $blocks)
+ = stat($dstfilename);
+ ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
+ $atime, $mtime2, $ctime, $blksize, $blocks)
+ = stat($filename);
+ if($mtime1 >= $mtime2){
+ $idstring2 = `identify -format "%w x %h %[depth] " $dstfilename`;
+ if($idstring2 =~ /(\d+) x (\d+) (\d+)/){
+ $existwidth = $1;
+ if($existwidth == $dstwidth){
+ $processedimages{$filename} = $existwidth;
+ $skipped++;
+ return;
+ }
+ }
+ }
+ }
+ if(($dstwidth >= $srcwidth) ||
+ ($dstwidth *(100 + $tolerance)/100 >= $srcwidth)) {
+ # we do no upscaling, but will probably copy the file.
+ if (defined $processedimages{$filename}){
+ $skipped++;
+ }else {
+ $processedimages{$filename} = $srcwidth;
+ print "will copy $filename to $dstfilename\n" if $verbose;
+ copy($filename, $dstfilename);
+ $copied++;
+ return;
+ }
+ }else {
+ if((defined $processedimages{$filename}) &&
+ ($processedimages{$filename} >= $dstwidth)) {
+ $skipped++;
+ return;
+ }
+ # we do some downscaling
+ $processedimages{$filename} = $dstwidth;
+ $convertargs[0] = 'convert';
+ $convertargs[1] = ${filename};
+ $convertargs[2] = '-resize';
+# $convertargs[3] = "${dstwidth}x${dstheight}!";
+ $convertargs[3] = "${dstwidth}x${dstheight}";
+ $convertargs[4] = "-density";
+ $convertargs[5] = $printdpi;
+ $convertargs[6] = ${dstfilename};
+ print "will @convertargs\n" if $verbose;
+ system(@convertargs);
+ $scaled++;
+ }
+}
+
+sub readlog
+{
+ my $logfilename = shift;
+ $logfilename .= '.log';
+ my ($picname, $picext, $picwidth, $picheight);
+ my ($picextu, $state, $buffer);
+ open LOGFILE, "<$logfilename" or die "Cannot read $logfilename";
+ $state = 0;
+ while (<LOGFILE>){
+ if (/^Package pdftex\.def\sInfo\:\s/){
+ $buffer = $_;
+ unless ($buffer =~ /\sused/){
+ chomp $buffer;
+ $buffer .= <LOGFILE>;
+ } # twice ought to be enough
+ unless ($buffer =~ /\sused/){
+ chomp $buffer;
+ $buffer .= <LOGFILE>;
+ }
+ if($buffer =~ /Info:\s(\S*)\.(\w+)\sused/){
+ $picname = $1;
+ $picext = $2;
+ ($picextu = $picext) =~ tr/a-z/A-Z/;
+ if(defined $canhandle{$picextu}){
+ $state = 1;
+ next;
+ }
+ }
+ }
+ next unless ($state == 1);
+ next unless /Requested size: (\d+\.\d+)pt x (\d+\.\d+)pt/;
+ $picwidth = $1;
+ $picheight = $2;
+ handleImage("$picname.$picext", $picwidth, $picheight);
+ $state = 0;
+ }
+}
+
+sub usage
+{
+ print <<'_endusage';
+pdflatexpicscale will downscale large raster images for your TeX project
+to reasonable size.
+Basic usage:
+ pdflatexpicscale myarticle
+where your main LaTeX file is called 'myarticle.tex' and a log file exists.
+Fine tuning:
+--destdir=folder (relative path, must exist,
+ defaults to 'printimg' subfolder of current folder)
+--srcdir=folder (folder to find original images, if this software
+ can't figure it out on it's own, because you already
+ used the target directory.)
+--printdpi=XXX (default 300)
+--tolerance=XX (default 20 Percents over printdpi to ignore scaling)
+--verbose (if you want to know what the script attempts to do)
+--version (show software version)
+_endusage
+}
+
+GetOptions('verbose' => \$verbose,
+ 'printdpi=i' => \$printdpi,
+ 'destdir=s' => \$printfolderprefix,
+ 'tolerance=i' => \$tolerance,
+ 'srcdir=s' => \$srcfolder,
+ 'version' => \$showversion,
+ 'help' => \$help,
+ 'usage' => \$help,
+ );
+
+
+if($showversion){
+ print "pdflatexpicscale Version $version $versiondate\n";
+}
+
+if($help){
+ usage();
+}
+
+$TeXproject = shift;
+
+if((defined $TeXproject) && ($TeXproject gt ' ')){
+ readlog($TeXproject);
+ if($verbose) {
+ print "pdflatexpicscale Version $version:\n"
+ . "$copied file(s) copied, $scaled file(s) converted " .
+ "and $skipped occurence(s) skipped for:\n${TeXproject}.log.\n";
+ }
+}else {
+ usage();
+}
diff --git a/support/pdflatexpicscale/pdflatexpicscale.tex b/support/pdflatexpicscale/pdflatexpicscale.tex
new file mode 100644
index 0000000000..e3b740a51a
--- /dev/null
+++ b/support/pdflatexpicscale/pdflatexpicscale.tex
@@ -0,0 +1,339 @@
+\documentclass[10pt,a4paper]{article}
+\usepackage{hologo} % used for LuaTeX, PdfTeX and PdfLaTeX logos
+\usepackage{graphicx}
+\usepackage{textcomp}
+\usepackage{url}
+\title{pdflatexpicscale}
+\author{Peter Willadt\footnote{willadt at t-online.de}}
+\date{2018-02-12} %version #version
+\begin{document}
+\maketitle
+
+\begin{abstract}
+ \noindent pdflatexpicscale is software that scales bitmap images to be
+ included into Pdf\LaTeX\ documents down to a size sufficient for printing.
+ This document describes installation and usage.
+\end{abstract}
+
+\tableofcontents
+
+\section{Introduction}
+
+Picture size matters. Digital cameras produce unnecessary large images, this
+leads to excessive download times and wasted processing power in the print
+driver, for example. Tuning images by hand is fine, but it costs lots of time
+and there may be situations where you need e.g. low-res pictures for the web
+and high-res pictures for print. When there are requirements that force the
+size of images in our document to change, the fun will probably be gone.
+
+There is a freely accessible article\label{tugboatart} in TUGboat (\url{%
+https://www.tug.org/TUGboat/tb37-3/tb117willadt.pdf}) accompanying
+this package.
+
+
+\subsection{Similiar Work/Prior Art}
+
+There have been prior attempts to do similiar things. I found
+\texttt{degrade.sty}\footnote{see
+ \url{http://mirror.ctan.org/graphics/degrade}}
+ and an equivalent con\TeX t module, there are at least two threads on
+ stackexchange\footnote{see
+ \texttt{http://tex.stackexchange.com/questions/14429/\\
+pdftex-reduce-pdf-size-reduce-image-quality}
+and
+\texttt{http://tex.stackexchange.com/\\questions/2198/how-to-create-small-pdf-files-for-the-internet}}
+ and there had been, as
+I have learned, some work by Axel Berger and others, posted 2011-03-31 on
+\texttt{de.comp.text.tex}.
+
+But what motivated me most to find something better than scaling pictures
+individually was seeing that Adobe InDesign\textregistered\ does
+scale graphics according to the output intent.
+
+\section{Installation}
+
+\subsection{Prerequisites}
+
+You have to install ImageMagick and Perl. If you are using Linux, please use
+the tools of your distribution, if they are not already installed. As a
+windows user, you may probably use the official ImageMagick distribution at
+\url{http://www.imagemagick.org/script/download.php}. For Perl, you got more
+options. I have tested pdflatexpicscale with ActiveState ActivePerl, but other
+distributions should work too.
+
+You also need the following Perl modules: \texttt{File::Basename},
+\texttt{File::Spec}, \texttt{File::Copy}, and \texttt{Getopt::Long}. There are
+several ways to get these modules, if you have not got them already:
+
+\begin{itemize}
+\item use your Linux distribution's software manager
+\item use the Perl CPAN module
+\item use ActiveState's \texttt{ppm} software, if you use ActivePerl.
+\end{itemize}
+
+Detailled description of these procedures is beyond the scope of this
+document.
+
+There are no special requirements for the versions of the software to install,
+but it may be wise to use recent versions, as there have been security flaws
+with ImageMagick.
+
+\subsection{Installation}
+
+If the prerequisites have been fulfilled (which is perhaps standard for a
+Linux computer), it is sufficient to move the file
+\texttt{pdflatexpicscale.pl} to a place that is included in your PATH and to
+make it executable. Of course, there are alternatives. You may perhaps
+prefer to type\\
+\texttt{perl /path/to/pdflatexpicscale.pl myarticle}\\
+instead.
+
+\section{Basic usage}
+
+\subsection{Preparing your \LaTeX\ file, Part~1}
+
+I will assume that you use the graphicx package to include images. The most
+important point is \emph{not} to give path names when you use
+\verb|\includegraphics|. You do not have to keep all graphics in the current
+directory, as the graphicx package comes with the
+\verb|\graphicspath| directive.
+
+So, if you have all images in the directory where your \LaTeX\ file resides,
+you are done with this. If not, you should undertake the following steps:
+
+\begin{enumerate}
+\item List every path to images within the \verb|\graphicspath| directive.
+\item Remove the paths from the \verb|\includegraphics| commands.
+\end{enumerate}
+
+Here is an example: If your \LaTeX\ file looks like this:
+
+\begin{verbatim}
+Some text...
+\includegraphics[size=2in]{/home/fred/photo1}
+Some other text...
+\includegraphics[size=1in]{/srv/www/htdocs/logo}
+\end{verbatim}
+
+then you should edit it to the following:
+
+\begin{verbatim}
+\graphicspath{{/home/fred/}{/srv/www/htdocs/}}
+Some text...
+\includegraphics[size=2in]{photo1}
+Some other text...
+\includegraphics[size=1in]{logo}
+\end{verbatim}
+
+You hopefully do not have distinct pictures with the same name in the listed
+folders. With \verb|\graphicspath| you have to use double braces, even if you
+use only one directory.
+
+\subsection{Preparing your \LaTeX\ file, Part~2}
+
+As size and resolution of images will change, you should specify the display
+size of your images by means that are independent of the image, e.g. by using
+something like\\
+\verb|\includegraphics[width=.3\textwidth]{...}|\\
+or\\
+\verb|\includegraphics[width=2cm]{...}|
+
+\subsection{A complete example}
+
+The workflow looks like this:
+
+\begin{itemize}
+\item Edit your file.
+\item Run Pdf\LaTeX\ on your file.
+\item Create a directory for your scaled pictures.
+\item Run pdflatexpicscale on your file.
+\item Change the \verb|\graphicspath| directive in your file to use the
+ downscaled images.
+\item Run Pdf\LaTeX\ on your file.
+\end{itemize}
+
+Let us assume that your \LaTeX\ document is called \texttt{myarticle.tex},
+that all images reside in the project directory and that you have done the
+preparation steps described above. Let us further assume that you want to
+produce a PDF file suitable for preview with 72~dpi image resolution.
+
+So you create a subdirectory called \texttt{previewpix} and run Pdf\LaTeX\
+like usual on \texttt{myarticle}. Then you issue\\
+\texttt{pdflatexpicscale --printdpi=72 --destdir=previewpix myarticle}
+
+If you are curious, you may insert \texttt{--verbose} anywhere before your
+project name (and before running it). Then you fire up your editor and add the
+following line near the beginning of your \LaTeX\ file:
+
+\verb|\graphicspath{{previewpix/}}|
+
+You may probably check the size of \texttt{myarticle.pdf}. Then run Pdf\LaTeX\
+again on \texttt{myarticle}. I have told you to use double braces with
+\verb|\graphicspath|, haven't I? If you still are curious, you can again
+check the size of \texttt{myarticle.pdf}.
+
+When it gets to preparing a print version, you create a directory for images
+with more detail, say \texttt{printpix}. You reset the \verb|\graphicspath|,
+run Pdf\LaTeX, issue\\
+\texttt{pdflatexpicscale --printdpi=300 --destdir=printpix myarticle}\\
+and set \verb|\graphicspath{{printpix/}}| before the next Pdf\LaTeX\ run.
+
+\section{Advanced usage}
+
+
+\subsection{Excluding files from scaling}
+
+You will probably exclude files from scaling when you think that scaling will
+do damage. You may achieve this by several means. Before you ask. Enumerating
+files to exclude is not really cool, so this is not supported.
+
+\begin{enumerate}
+\item Use \verb|\includegraphics| for this files with full path names. This is
+ uncool, but can be done.
+\item Pack these files into a special source directory. Read the following
+ explanation.
+\end{enumerate}
+
+It works like this: you create three directories for pictures:
+
+\begin{itemize}
+\item One for images to stay unscaled. Let's call it \texttt{hires}
+\item One for images to scale. Let's call it \texttt{images}
+\item One for downscaled images. Let's call it \texttt{printimg}
+\end{itemize}
+
+Then you use the feature of \verb|\graphicspath| to include several
+directories. Before the first \LaTeX\ run, you say\\
+\verb|\graphicspath{{hires/}{images/}}|
+and after pdflatexpicscale is through, you change it to\\
+\verb|\graphicspath{{hires/}{printimg/}}|
+
+\subsection{Gory details}
+
+pdflatexpicscale reads the log file, not the \LaTeX\ source. So you have to
+run Pdf\LaTeX\ at least once before something can happen.
+
+Pure black-and-white images will be treated different from other picture
+files: They get four times the resolution, as probably every pixel counts.
+Images that are only a little larger than ideal will not get scaled, but you
+may change this from the command line.
+If an image will not be scaled, it will be just copied to the destination
+directory.
+
+pdflatexpicscale looks only for the width of images, so if you intend do do
+anisotropic scaling you will not get best results.
+
+Clipping will not work with pdflatexpicscale. The \emph{graphicx} package
+devises picture size from the picture file, then applies clipping to it and
+afterwards does scaling, rotation and so on. As pdflatexpicscale changes
+pictures (as well dimensions as nominal resolution), clipping results will
+change too, you will end up with a mess. The same thing happens when you do
+not give the figure dimensions in units relying only on document properties
+(like page width).
+
+\subsection{Command line options}
+
+All command line options have to be prepended by two minus signs. If they take
+arguments, you should add an equal sign and the argument to your option. All
+command line options are optional, but you have to specify a project name.
+
+\paragraph{destdir} followed by \emph{a directory name relative to the current
+directory} specifies where the scaled pictures should go. The default is
+\texttt{printimg}. The directory has to exist, pdflatexpicscale will not
+create directories.
+
+\paragraph{printdpi} followed by the resolution in dpi lets you change the
+target resolution. Default is 300, for online use you may supply 96, e.g.
+
+\paragraph{srcdir} followed by \emph{the directory where your unscaled
+ pictures are} is normally not required, as pdflatexpicscale gets the path
+names from the log file it reads. You may set this option if you have already
+changed the \verb|\graphicspath| and are too lazy to change it again. The
+default is empty.
+
+\paragraph{tolerance} followed by a number lets you change the range in which
+pictures remain unscaled because they are near the target resolution. Default
+is 20, that means 20~percent. If target resolution is 300~dpi, files up to
+320~dpi get accepted too. Change to 0 if you want no tolerance.
+
+\paragraph{verbose} entertains you by showing what the program is about to
+do.
+
+\paragraph{version} shows the software version.
+
+Calling pdflatexpicscale without any options and without a project name will
+display a short usage text.
+
+\subsection{Printer testing}
+
+You can---and you should---actually print a file with images scaled to
+distinct resolutions and compare the results. If paper quality matters for you
+(inkjet user?), you should repeat this with different paper.
+
+If you belong to the once-privileged class of people who own a PostScript
+printer, you may copy the file testprinter.ps to your printer. For all other
+folks, this file is useless. Software like Ghostscript will convert the
+rasters to uniform colored areas. Anyway, here is what you should see:
+
+\begin{itemize}
+\item The uppermost part of the page will present squares filled with
+ lines. With my printer, 100~lpi is the best I can get.
+
+\item The middle part of the page shows squares with five levels of gray with
+ dotted raster. The result should be similiar.
+
+\item The bottom of the page is dedicated to the ends of the gray scale. Can
+ you distinguish 94\% gray from white? Or 6\% gray from black?
+
+\end{itemize}
+
+\section{License}
+
+pdflatexpicscale.pl and the accompanying files are subject to the current
+version of the \LaTeX\ project public license.
+
+\section{Bugs, Improvements, and Changes}
+
+Please submit bug reports to the package author (me). I will be glad to make
+the package better.\label{bugs}
+
+The file version dates of all the files in this package shall be kept
+consistent, even if only one of the files changes. pdflatexpicscale.pl,
+however, has also a version number. This number will only be changed when
+there are functional changes to pdflatexpicscale.pl.
+
+\subsection{Changelog}
+
+\paragraph{2016-07-28} Upload of first public version to CTAN.
+
+\paragraph{2016-07-31} Reformatted \emph{Gory details} section and added
+information about anisotropic scaling and clipping
+
+\paragraph{2016-08-02} Fixed some typos. Corrected handling of lines wrapped
+in the log file.
+
+\paragraph{2016-10-20} Removed a nagging error message when the program was
+called without arguments. Added the argument \texttt{--help}, both due to
+suggestions by Karl Berry (thanks a lot).
+
+\paragraph{2016-12-12} Section on similiar work and prior art added (on request).
+
+\paragraph{2017-01-22} Added url of TUGboat article.
+
+\paragraph{2017-01-23} Fixed inconsistent version numbers and changed the url
+of degrade.sty on recommendation of CTAN board. Added text on versioning at
+the beginning of section~\ref{bugs}. Thanks a lot to the always quick action
+and helpful and polite hints.
+
+\paragraph{2017-02-01} With very long pathnames in the log file,
+pdflatexpicscale did not find pictures. This is fixed, hopefully.
+
+\paragraph{2018-02-12} Only changes to this document, not to the software: In
+this document, the option \texttt{tolerance} had been listed as
+\texttt{printdpi}. From now on, this is corrected.
+
+As the TUGboat article corresponding to pdflatexpicscale is freely available
+now, the link on page~\pageref{tugboatart} has been adjusted.
+
+% for file version please see line 8
+\end{document}
diff --git a/support/pdflatexpicscale/testprinter.ps b/support/pdflatexpicscale/testprinter.ps
new file mode 100644
index 0000000000..900fe5dc8e
--- /dev/null
+++ b/support/pdflatexpicscale/testprinter.ps
@@ -0,0 +1,211 @@
+%!PS
+% Halftone testing inspired by
+% McGilton, Henry and Campione, Mary:
+% PostScript by Example.
+% First printing, 1992, P. 544 ff
+% Willadt 2016-07-27
+% version 2018-02-12 #version %version
+% for information on usage and changes see pdflatexpicscale.pdf
+/prozente 20 string def
+
+/Palatino-Roman findfont
+36 scalefont
+setfont
+72 60 moveto
+(Gray scale test) show
+
+/Palatino-Roman findfont
+10 scalefont
+setfont
+
+444 60 moveto
+(Version 2016-07-27) show
+72 100 translate
+
+/raster
+{
+ 5 mul
+ dup
+ 0 60 moveto
+ 0 setgray
+ prozente cvs show
+ ( lpi) show
+ 0 {dup mul exch dup mul add 1 exch sub } setscreen
+ .45 setgray
+ 0 0 moveto
+ 0 50 lineto
+ 10 50 lineto
+ 10 0 lineto
+ closepath
+ fill
+ .5 setgray
+ 10 0 moveto
+ 10 50 lineto
+ 20 50 lineto
+ 20 0 lineto
+ closepath
+ fill
+ .55 setgray
+ 20 0 moveto
+ 20 50 lineto
+ 30 50 lineto
+ 30 0 lineto
+ closepath
+ fill
+ .6 setgray
+ 30 0 moveto
+ 30 50 lineto
+ 40 50 lineto
+ 40 0 lineto
+ closepath
+ fill
+ .65 setgray
+ 40 0 moveto
+ 40 50 lineto
+ 50 50 lineto
+ 50 0 lineto
+ closepath
+ fill
+ 60 0 translate
+} def
+
+/rechteck
+{
+ 0 0 moveto
+ 0 50 lineto
+ 40 50 lineto
+ 40 0 lineto
+ closepath
+ dup
+% gsave
+ setgray
+ fill
+% grestore
+ 100 mul
+ 0 60 moveto
+ 0 setgray
+ prozente cvs show
+ ( %) show
+ 50 0 translate
+} def
+
+0 rechteck
+0.02 rechteck
+0.04 rechteck
+0.06 rechteck
+0.08 rechteck
+0.1 rechteck
+0.12 rechteck
+0.15 rechteck
+0.2 rechteck
+-450 80 translate
+0.8 rechteck
+0.85 rechteck
+0.88 rechteck
+0.9 rechteck
+0.92 rechteck
+0.94 rechteck
+0.96 rechteck
+0.98 rechteck
+1 rechteck
+-450 80 translate
+/Palatino-Roman findfont
+36 scalefont
+setfont
+0 0 moveto
+(Raster test) show
+0 0 moveto
+0 50 translate
+/Palatino-Roman findfont
+10 scalefont
+setfont
+
+0 setgray
+5 raster
+6 raster
+7 raster
+8 raster
+9 raster
+10 raster
+11 raster
+12 raster
+-480 70 translate
+13 raster
+14 raster
+15 raster
+16 raster
+17 raster
+18 raster
+19 raster
+20 raster
+-480 70 translate
+21 raster
+22 raster
+23 raster
+24 raster
+25 raster
+26 raster
+27 raster
+28 raster
+-480 70 translate
+0 setgray
+/Palatino-Roman findfont
+36 scalefont
+setfont
+0 0 moveto
+(Line test) show
+0 0 moveto
+0 50 translate
+/Palatino-Roman findfont
+10 scalefont
+setfont
+
+0 setlinewidth
+
+/linien
+{
+ 0 60 moveto
+ 5 mul
+ dup dup
+ prozente cvs show
+ ( lpi) show
+ 0 exch 72 exch div 50 {
+ dup
+ 0 moveto
+ 50 lineto
+ stroke
+ }for
+ 60 0 translate
+} def
+
+
+
+ 5 linien
+ 6 linien
+ 7 linien
+ 8 linien
+ 9 linien
+ 10 linien
+ 11 linien
+ 12 linien
+-480 70 translate
+ 13 linien
+ 14 linien
+ 15 linien
+ 16 linien
+ 17 linien
+ 18 linien
+ 19 linien
+ 20 linien
+ -480 70 translate
+ 21 linien
+ 22 linien
+ 23 linien
+ 24 linien
+ 25 linien
+ 26 linien
+ 27 linien
+ 28 linien
+
+
+showpage