else {
my $pdf = PDF::FromHTML->new( encoding => 'utf-8' );
$pdf->load_file( $html_path );
-=for params
-=cut
- $pdf->convert;
+
+ my $ttf = C4::Context->config('ttf');
+ if ( $ttf && exists $ttf->{font} ) {
+
+ use Data::Dump qw(dump);
+warn "XXX ttf = ",dump($ttf);
+
+ my $type2path;
+ foreach my $font ( @{ $ttf->{font} } ) {
+ $type2path->{ $font->{type} } = $font->{content};
+ }
+
+ warn "# type2path = ",dump($type2path);
+
+
+ $pdf->convert(
+# PageWidth 640
+# PageResolution 540
+# FontBold 'HelveticaBold'
+# FontOblique 'HelveticaOblique'
+# FontBoldOblique 'HelveticaBoldOblique'
+# LineHeight 12
+# FontUnicode 'Helvetica'
+# Font (same as FontUnicode)
+# PageSize 'A4'
+# Landscape 0
+
+ FontBold => $type2path->{'HB'} || 'HelveticaBold',
+ FontOblique => $type2path->{'HO'} || 'HelveticaOblique',
+ FontBoldOblique => $type2path->{'HBO'}|| 'HelveticaBoldOblique',
+ FontUnicode => $type2path->{'H'} || 'Helvetica',
+ Font => $type2path->{'H'} || 'Helvetica',
+ );
+ }
$pdf->write_file( $pdf_path );
}