|
Hello All!
The following small program works correctly as a standalone program, and produces a valid PDF document:
#!/usr/bin/perl
use HTML::HTMLDoc;
my $htmldoc = new HTML::HTMLDoc();
$htmldoc->set_html_content(qq~<html><body>A PDF file</body></html>~);
my $pdf = $htmldoc->generate_pdf();
print $pdf->to_string();
but the following code inserted into my main program produces an empty string:
my $htmldoc = new HTML::HTMLDoc();
$htmldoc->set_html_content(qq~<html><body>A PDF file</body></html>~);
my $pdf = $htmldoc->generate_pdf();
dump( $htmldoc, $pdf, $pdf->to_string() );
The output from the dump, which invokes Data::Dumper, is:
$VAR1 = bless( {
'html' => '<html><body>A PDF file</body></html>',
'errors' => [],
'config' => {
'tmpdir' => '/tmp',
'mode' => 'ipc'
},
'doc_config' => {
'quiet' => undef,
'format' => 'pdf',
'charset' => 'iso-8859-1',
'portrait' => '',
'header' => '.t.',
'footer' => '.1.',
'size' => 'a4'
}
}, 'HTML::HTMLDoc' );
$VAR2 = bless( {
'content' => \''
}, 'HTML::HTMLDoc::PDF' );
$VAR3 = '';
Any ideas on what could be the cause? |