stuff, you might even need the latest AFPL version from CVS, if you
can live with its license.) http://www.ghostscript.com/ has it all.
- vim (http://www.vim.org/).
+ - gnome-web-photo, currently only available from GNOME's CVS
+ (http://cvs.gnome.org/viewcvs/gnome-web-photo/, do
+ cvs -d :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome co gnome-web-photo
+ to check out).
[1]: http://home.samfundet.no/~sesse/mpm-itk/
nohup Xvfb :25 &
+(Note that gnome-web-photo seems to be a bit picky about the color depth.
+If you get all black images in your PDFs, add "-screen scrn 800x600x24"
+to the Xvfb command line and see if it helps.)
+
Then, you'll need to log in as the CGI user (yes, yuck :-) ), run
OpenOffice.org for the first time, accept the license etc. Then you'll have
to add a new printer -- use spadmin (in the same directory as soffice), add
my $cgi = CGI->new;
my $filename = $cgi->param('input');
my $file = $cgi->upload('input');
+my $url = $cgi->param('url');
# It kind of sucks that we just can't get the temporary file name from
# CGI.pm, but OK, here goes :-)
$psopts = "";
}
-if ($filename =~ /(.*)\.(?:e?ps|pdf)$/i) {
+if ($url =~ /^http/i) {
+ $outname = "web.pdf";
+
+ # Render through Gecko
+ $ENV{'DISPLAY'} = $pdfweb::config::xserver;
+ system("gnome-web-print", $url, "$pdfweb::config::outputdir/$pdf_filename.ps");
+ system("gs $pdfopts -dCompatbilityLevel=1.4 -dNOPAUSE -dPATCH -sDEVICE=pdfwrite -dSAFER -sOutputFile=output/$pdf_filename -c '.setpdfwrite $psopts' -f - < $pdfweb::config::outputdir/$pdf_filename.ps >&2");
+} elsif ($filename =~ /(.*)\.(?:e?ps|pdf)$/i) {
$outname = "$1.pdf";
# Yay, just a round through GhostScript
<th>File:</th>
<td><input type="file" name="input" /></td>
</tr>
+ <tr>
+ <th><em>or</em> URL:</th>
+ <td><input type="text" name="url" size="40" /></td>
+ </tr>
<tr>
<th>PDF preset:</th>
<td>
slightly sketchy at times, let me know if it's broken).</li>
<li>Lots of different programming-related formats (.c, .pl, .js, etc.),
via <a href="http://www.vim.org/">Vim</a>.</li>
+ <li>Web pages, via <a href="http://www.mozilla.org/newlayout/">Gecko</a>
+ and <a href="http://cvs.gnome.org/viewcvs/gnome-web-photo/">gnome-web-photo</a>
+ (thanks to Tommi Komulainen for telling me about the latter :-) ).</li>
</ul>
- <p>If somebody knows a good way of getting a Gecko-based browser to
- convert from an URL or HTML file to PostScript (on the command line),
- please let me know; I'd guess HTML would be the most-wanted format
- missing. :-)</p>
-
<h2>Source code</h2>
<p>I've had a few requests for the source code, so I put it online in