File: topdf.pl

package info (click to toggle)
htmldoc 1.8.27-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 11,708 kB
  • ctags: 5,685
  • sloc: ansic: 43,156; cpp: 22,678; perl: 395; makefile: 303; java: 59; php: 36; xml: 10; sh: 7
file content (15 lines) | stat: -rw-r--r-- 367 bytes parent folder | download | duplicates (13)
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";
}