From: Steinar H. Gunderson
Date: Tue, 9 Aug 2005 00:39:59 +0000 (+0000)
Subject: Added support for showing the last submitted PDFs in a thumbnail fashion.
X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=b943073892273418899c8187f9055d7faede1a0d;hp=07e40b2b0a31439e2697b08f27d51b2dea31b615;p=webpdf
Added support for showing the last submitted PDFs in a thumbnail fashion.
---
diff --git a/README b/README
index a011536..f7c6881 100644
--- a/README
+++ b/README
@@ -5,7 +5,7 @@ You'll need:
- A web server (I use Apache 2, with mpm-itk[1] to separate the ugliness
from the rest of the server installation).
- ImageMagick (http://www.imagemagick.org/).
- - Perl (http://www.perl.org/), with the CGI module.
+ - Perl (http://www.perl.org/), with the CGI and HTML::Entities modules.
- OpenOffice.org (http://www.openoffice.org/ -- doh), tested with v1.1
only. See below for special configuration needed.
- GhostScript, probably almost any halfway recent version; newer ones
diff --git a/createpdf.pl b/createpdf.pl
index 6147e7e..f33bbc5 100755
--- a/createpdf.pl
+++ b/createpdf.pl
@@ -153,6 +153,22 @@ EOF
exit;
}
+# Make a thumbnail from the finished PDF, for later reference. (Output to
+# stdout is so we make sure we get only the first page; it's the simplest
+# hack I can find offhand. :-) )
+system("convert -resize 192x192 output/$pdf_filename png:- > output/$pdf_filename.png");
+open DESC, ">output/$pdf_filename.desc";
+
+if ($url =~ /^http/i) {
+ $url =~ tr/\n//d;
+ print DESC "$url\n";
+} else {
+ $filename =~ tr/\n//d;
+ print DESC "$filename\n";
+}
+
+close DESC;
+
my $size = -s "output/$pdf_filename";
(my $sanitized_outname = $outname) =~ tr/a-zA-Z0-9. -/_/c;
diff --git a/index.html b/index.html
index c23881f..0aff6ad 100644
--- a/index.html
+++ b/index.html
@@ -62,8 +62,9 @@
multi-gigabyte jobs etc. on it regularily I might just not be able to
do that. Please be nice :-)
-
Note that there is minimal security involved; if I feel like it, I
- might even take a look at what people are processing. Do not submit
+
Note that there is minimal security involved; you can even look at
+ the last 20 submitted jobs at any time (this
+ is also handy for resuming a big download). Do not submit
any sensitive data!