File: topdf.pl

package info (click to toggle)
htmldoc 1.8.23-1.3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 9,424 kB
  • ctags: 7,225
  • sloc: ansic: 59,174; cpp: 24,188; sh: 4,697; asm: 996; pascal: 677; makefile: 455; java: 59; php: 36; 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";
}