bug 4188: move PDF templates for printed purchase orders

The PDF templates for purchase orders now live in the
directory koha-tmpl/intranet-tmpl/prog/pdf to separate
them from code.  As no automatic translation system for
PDF files is currently implemented, I'm keeping them out
of the language subdirectories for now.

At present, there are two choices of templates for printing
purchase orders (AKA basket groups), controlled by setting
the OrderPdfFormat syspref:

pdfformat::layout2pages (two-page layout)
pdfformat::layout3pages (three-page layout)

To customize a template or to add a new one requires two steps:

* modifying the PDF; note that OpenOffice source files
  are included as a way of generating the PDF
* modifying the code in acqui/pdfformat/layout*.pm to
  position the order text onto the template

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Galen Charlton 2010-07-02 08:39:46 -04:00
parent b1c1f6f434
commit 1457256b98
7 changed files with 5 additions and 11 deletions

View File

@ -267,7 +267,7 @@ sub _get_language_dirs {
next if $lang_string =~/css$/;
next if $lang_string =~/CVS$/;
next if $lang_string =~/\.txt$/i; #Don't read the readme.txt !
next if $lang_string =~/img|images|famfam|sound/;
next if $lang_string =~/img|images|famfam|sound|pdf/;
push @lang_strings, $lang_string;
}
return (@lang_strings);

View File

@ -236,11 +236,8 @@ sub printfooters {
sub printpdf {
my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_;
# open the default PDF that will be used for base (1st page already filled)
use FindBin qw( $Bin );
open(my $fh, "$Bin/pdfformat/layout2pages.pdf") or die "$@";
my @pdf = <$fh>;
close($fh);
my $pdf = PDF::API2->openScalar(join('', @pdf));
my $pdf_template = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('template') . '/pdf/layout2pages.pdf';
my $pdf = PDF::API2->open($pdf_template);
$pdf->pageLabel( 0, {
-style => 'roman',
} ); # start with roman numbering

View File

@ -373,11 +373,8 @@ sub printfooters {
sub printpdf {
my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_;
# open the default PDF that will be used for base (1st page already filled)
use FindBin qw( $Bin );
open(my $fh, "$Bin/pdfformat/layout3pages.pdf") or die "$@";
my @pdf = <$fh>;
close($fh);
my $pdf = PDF::API2->openScalar(join('', @pdf));
my $pdf_template = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('template') . '/pdf/layout3pages.pdf';
my $pdf = PDF::API2->open($pdf_template);
$pdf->pageLabel( 0, {
-style => 'roman',
} ); # start with roman numbering