Support FG/BG colors in web pages. master
authorSteinar H. Gunderson <sesse@samfundet.no>
Sun, 14 Aug 2005 23:43:38 +0000 (23:43 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sun, 14 Aug 2005 23:43:38 +0000 (23:43 +0000)
createpdf.pl
index.html

index e74ab0e..249b217 100755 (executable)
@@ -57,10 +57,15 @@ if ($cgi->param('preset') eq 'screen') {
 
 if ($url =~ /^http/i) {
        $outname = "web.pdf";
+       my @options = ("-f");
+
+       if (defined($cgi->param('color'))) {
+               push @options, "-c";
+       }
 
        # Render through Gecko
        $ENV{'DISPLAY'} = $pdfweb::config::xserver;
-       system("gnome-web-print", "-f", $url, "$pdfweb::config::outputdir/$pdf_filename.ps");
+       system("gnome-web-print", @options, $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";
index c8106fa..77ff323 100644 (file)
@@ -16,7 +16,7 @@
     <div class="boxes">
       <div class="info">
         <h2>Last updated</h2>
-        <p id="lastupdated">August 12th, 2005</p>
+        <p id="lastupdated">August 15th, 2005</p>
       </div>
 
       <div class="nav">
          </td>
        </tr>
        <tr>
+         <td></td>
+         <td><input name="color" type="checkbox" /> Preserve FG/BG color in web pages</td>
+       </tr>
+       <tr>
          <th colspan="2">
            <input type="submit" value="Make PDF" />
          </th>