File: topdf.pl

package info (click to toggle)
htmldoc 1.9.11-4%2Bdeb11u3
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 14,976 kB
  • sloc: ansic: 70,003; cpp: 24,681; makefile: 362; sh: 149; java: 59; php: 36; python: 13; xml: 10; perl: 7
file content (15 lines) | stat: -rw-r--r-- 367 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sub topdf(filename);

sub topdf {
    # Get the filename argument...
    my $filename = shift;

    # Make stdout unbuffered...
    select(STDOUT); $| = 1;

    # Write the content type to the client...
    print "Content-Type: application/pdf\n\n";

    # Run HTMLDOC to provide the PDF file to the user...
    system "htmldoc -t pdf --quiet --webpage $filename";
}