Thread Problem mit PDF::FromHTML (6 answers)
Opened by bianca at 2010-01-12 13:47

bianca
 2010-01-12 13:47
#130446 #130446
User since
2009-09-13
7016 Artikel
BenutzerIn

user image
Wollte zu o.a. Modul um Hilfe bitten.
Habe es auf Vista mit ActivePerl 5.10.0 installiert wie folgt:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
PDF-FromHTML marked for install
PDF-FromHTML depends on Image-Size
PDF-FromHTML depends on XML-Twig
PDF-FromHTML depends on Graphics-ColorNames
PDF-FromHTML depends on Scalar-List-Utils
PDF-FromHTML depends on PDF-Writer
Installing 6 packages ...
Downloading PDF-FromHTML-0.31 ... done
Downloading Image-Size-3.220 ... done
Downloading XML-Twig-3.32 ... done
Downloading Graphics-ColorNames-2.11 ... done
Downloading Scalar-List-Utils-1.22 ... done
Downloading PDF-Writer-0.06 ... done
Unpacking PDF-FromHTML-0.31 ... done
Unpacking Image-Size-3.220 ... done
Unpacking XML-Twig-3.32 ... done
Unpacking Graphics-ColorNames-2.11 ... done
Unpacking Scalar-List-Utils-1.22 ... done
Unpacking PDF-Writer-0.06 ... done
Generating HTML for PDF-FromHTML-0.31 ... done
Generating HTML for Image-Size-3.220 ... done
Generating HTML for XML-Twig-3.32 ... done
Generating HTML for Graphics-ColorNames-2.11 ... done
Generating HTML for Scalar-List-Utils-1.22 ... done
Generating HTML for PDF-Writer-0.06 ... done
Updating files in site area ... done
Installing 6 packages done


Test HTML-Datei:
Code: (dl )
1
2
3
4
5
6
7
8
<html>
<head>
<title>testpdf.html</title>
</head>
<body>
<p>Testseite</p>
</body>
</html>


Test Perl Script:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl -w
use strict;
use warnings;
use PDF::FromHTML;

my $pdf = PDF::FromHTML->new( encoding => 'utf-8' );

# Loading from a file:
$pdf->load_file('testpdf.html');

# Perform the actual conversion:
$pdf->convert(
    # With PDF::API2, font names such as 'traditional' also works
    Font        => 'ariali.ttf',
    LineHeight  => 10,
    Landscape   => 1,
);

# Write to a file:
$pdf->write_file('testpdf.pdf');


Ergebnis:
Code: (dl )
1
2
C:\Arbeit>perl testpdf.pl
Undefined subroutine &PDF::FromHTML::HAS_HTML_TIDY called at C:/Perl/site/lib/PDF/FromHTML.pm line 124.


Die Datei ariali.ttf liegt im gleichen Verzeichnis wie mein Perl Script und wurde aus dem Fonts Ordner von Windows rüber kopiert.

Hat jemand eine Idee, was falsch läuft?

Vielen Dank
10 print "Hallo"
20 goto 10

View full thread Problem mit PDF::FromHTML