View | Details | Raw Unified | Return to bug 8007
Collapse All | Expand All

(-)a/C4/Installer/PerlDependencies.pm (-2 / +2 lines)
Lines 737-746 our $PERL_DEPS = { Link Here
737
        'required' => '0',
737
        'required' => '0',
738
        'min_ver'  => '5.61',
738
        'min_ver'  => '5.61',
739
    },
739
    },
740
    'HTML:HTMLDoc' => {
740
    'PDF::FromHTML' => {
741
        'usage'    => 'Discharge generation',
741
        'usage'    => 'Discharge generation',
742
        'required' => '0',
742
        'required' => '0',
743
        'min_ver'  => '0.07',
743
        'min_ver'  => '0.31',
744
    },
744
    },
745
};
745
};
746
746
(-)a/Koha/Borrower/Discharge.pm (-6 / +11 lines)
Lines 3-9 package Koha::Borrower::Discharge; Link Here
3
use Modern::Perl;
3
use Modern::Perl;
4
use CGI;
4
use CGI;
5
use File::Temp qw( :POSIX );
5
use File::Temp qw( :POSIX );
6
use HTML::HTMLDoc;
6
use PDF::FromHTML;
7
7
8
use C4::Members qw( GetPendingIssues );
8
use C4::Members qw( GetPendingIssues );
9
use C4::Reserves qw( GetReservesFromBorrowernumber CancelReserve );
9
use C4::Reserves qw( GetReservesFromBorrowernumber CancelReserve );
Lines 108-117 sub generate_as_pdf { Link Here
108
        messages   => [$letter],
108
        messages   => [$letter],
109
    );
109
    );
110
110
111
    my $pdf_path = tmpnam();
111
    my $html_path = tmpnam() . '.html';
112
    my $htmldoc  = new HTML::HTMLDoc();
112
    my $pdf_path = tmpnam() . '.pdf';
113
    $htmldoc->set_html_content($tmpl->output);
113
    my $html_content = $tmpl->output;
114
    $htmldoc->generate_pdf()->to_file($pdf_path);
114
    open my $html_fh, '>', $html_path;
115
    say $html_fh $html_content;
116
    close $html_fh;
117
    my $pdf = PDF::FromHTML->new( encoding => 'utf-8' );
118
    $pdf->load_file( $html_path );
119
    $pdf->convert;
120
    $pdf->write_file( $pdf_path );
115
121
116
    return $pdf_path;
122
    return $pdf_path;
117
}
123
}
118
- 

Return to bug 8007