Lines 142-148
sub generate_as_pdf {
Link Here
|
142 |
else { |
142 |
else { |
143 |
my $pdf = PDF::FromHTML->new( encoding => 'utf-8' ); |
143 |
my $pdf = PDF::FromHTML->new( encoding => 'utf-8' ); |
144 |
$pdf->load_file( $html_path ); |
144 |
$pdf->load_file( $html_path ); |
145 |
$pdf->convert; |
145 |
|
|
|
146 |
my $ttf = C4::Context->config('ttf'); |
147 |
if ( $ttf && exists $ttf->{font} ) { |
148 |
|
149 |
my $type2path; |
150 |
foreach my $font ( @{ $ttf->{font} } ) { |
151 |
$type2path->{ $font->{type} } = $font->{content}; |
152 |
} |
153 |
|
154 |
$pdf->convert( |
155 |
FontBold => $type2path->{'HB'} || 'HelveticaBold', |
156 |
FontOblique => $type2path->{'HO'} || 'HelveticaOblique', |
157 |
FontBoldOblique => $type2path->{'HBO'}|| 'HelveticaBoldOblique', |
158 |
FontUnicode => $type2path->{'H'} || 'Helvetica', |
159 |
Font => $type2path->{'H'} || 'Helvetica', |
160 |
); |
161 |
} else { |
162 |
$pdf->convert(); |
163 |
} |
146 |
$pdf->write_file( $pdf_path ); |
164 |
$pdf->write_file( $pdf_path ); |
147 |
} |
165 |
} |
148 |
|
166 |
|
149 |
- |
|
|