Bugzilla – Attachment 36186 Details for
Bug 8007
Discharge management
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8007: Replace HTML::HTMLDoc with PDF::FromHTML
Bug-8007-Replace-HTMLHTMLDoc-with-PDFFromHTML.patch (text/plain), 1.92 KB, created by
Jonathan Druart
on 2015-02-26 15:05:40 UTC
(
hide
)
Description:
Bug 8007: Replace HTML::HTMLDoc with PDF::FromHTML
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-02-26 15:05:40 UTC
Size:
1.92 KB
patch
obsolete
>From 7440c47da9503e81df0ed78a2e61feba43f3cec4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 18 Dec 2014 15:39:46 +0100 >Subject: [PATCH] Bug 8007: Replace HTML::HTMLDoc with PDF::FromHTML > >--- > C4/Installer/PerlDependencies.pm | 4 ++-- > Koha/Borrower/Discharge.pm | 16 +++++++++++----- > 2 files changed, 13 insertions(+), 7 deletions(-) > >diff --git a/C4/Installer/PerlDependencies.pm b/C4/Installer/PerlDependencies.pm >index 7879596..7cedd6f 100644 >--- a/C4/Installer/PerlDependencies.pm >+++ b/C4/Installer/PerlDependencies.pm >@@ -742,10 +742,10 @@ our $PERL_DEPS = { > 'required' => '0', > 'min_ver' => '5.61', > }, >- 'HTML:HTMLDoc' => { >+ 'PDF::FromHTML' => { > 'usage' => 'Discharge generation', > 'required' => '0', >- 'min_ver' => '0.07', >+ 'min_ver' => '0.31', > }, > }; > >diff --git a/Koha/Borrower/Discharge.pm b/Koha/Borrower/Discharge.pm >index 6027e7e..1665bc7 100644 >--- a/Koha/Borrower/Discharge.pm >+++ b/Koha/Borrower/Discharge.pm >@@ -3,7 +3,7 @@ package Koha::Borrower::Discharge; > use Modern::Perl; > use CGI; > use File::Temp qw( :POSIX ); >-use HTML::HTMLDoc; >+use PDF::FromHTML; > > use C4::Members qw( GetPendingIssues ); > use C4::Reserves qw( GetReservesFromBorrowernumber CancelReserve ); >@@ -108,10 +108,16 @@ sub generate_as_pdf { > messages => [$letter], > ); > >- my $pdf_path = tmpnam(); >- my $htmldoc = new HTML::HTMLDoc(); >- $htmldoc->set_html_content($tmpl->output); >- $htmldoc->generate_pdf()->to_file($pdf_path); >+ my $html_path = tmpnam() . '.html'; >+ my $pdf_path = tmpnam() . '.pdf'; >+ my $html_content = $tmpl->output; >+ open my $html_fh, '>', $html_path; >+ say $html_fh $html_content; >+ close $html_fh; >+ my $pdf = PDF::FromHTML->new( encoding => 'utf-8' ); >+ $pdf->load_file( $html_path ); >+ $pdf->convert; >+ $pdf->write_file( $pdf_path ); > > return $pdf_path; > } >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8007
:
14490
|
16622
|
16935
|
17484
|
17485
|
21394
|
21395
|
21396
|
21660
|
21674
|
21675
|
21676
|
21677
|
21678
|
24023
|
24024
|
24025
|
24026
|
24027
|
30531
|
30532
|
30533
|
30534
|
30535
|
31007
|
34034
|
34035
|
34036
|
34037
|
34038
|
34039
|
34668
|
34669
|
34670
|
34671
|
34672
|
34673
|
34674
|
34675
|
36180
|
36181
|
36182
|
36183
|
36184
|
36185
|
36186
|
36187
|
36394
|
36395
|
36396
|
36397
|
36398
|
36399
|
36400
|
36401
|
37029
|
37030
|
37031
|
37032
|
37033
|
37034
|
37035
|
37036
|
37037
|
38596
|
38597