]> git.sesse.net Git - webpdf/commitdiff
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 e74ab0e0119a08a9e3297e5b4891d634d7d9aca1..249b217e5afddc80fee5fdcb5db144009d40bbb9 100755 (executable)
@@ -57,10 +57,15 @@ if ($cgi->param('preset') eq 'screen') {
 
 if ($url =~ /^http/i) {
        $outname = "web.pdf";
 
 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;
 
        # 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";
        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 c8106facb0a540e2ef83e6e3db81b238978dfc43..77ff3231cd98e8945cd87b3511c13fecaac5f06c 100644 (file)
@@ -16,7 +16,7 @@
     <div class="boxes">
       <div class="info">
         <h2>Last updated</h2>
     <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">
       </div>
 
       <div class="nav">
            </select>
          </td>
        </tr>
            </select>
          </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" />
        <tr>
          <th colspan="2">
            <input type="submit" value="Make PDF" />