File: topdf.pl

package info (click to toggle)
htmldoc 1.9.20-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,724 kB
  • sloc: cpp: 24,916; ansic: 4,714; sh: 3,262; makefile: 264; 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";
}