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

(-)a/C4/Creators/PDF.pm (-2 / +15 lines)
Lines 21-26 use strict; Link Here
21
use warnings;
21
use warnings;
22
use PDF::Reuse;
22
use PDF::Reuse;
23
use PDF::Reuse::Barcode;
23
use PDF::Reuse::Barcode;
24
use File::Temp;
24
25
25
BEGIN {
26
BEGIN {
26
    use version; our $VERSION = qv('1.0.0_1');
27
    use version; our $VERSION = qv('1.0.0_1');
Lines 42-48 sub new { Link Here
42
    delete($opts{InitVars});
43
    delete($opts{InitVars});
43
    prDocDir($opts{'DocDir'}) if $opts{'DocDir'};
44
    prDocDir($opts{'DocDir'}) if $opts{'DocDir'};
44
    delete($opts{'DocDir'});
45
    delete($opts{'DocDir'});
45
    prFile(%opts);
46
47
    my $fh = File::Temp->new( UNLINK => 0, SUFFIX => '.pdf' );
48
    $opts{Name} = $self->{filename} = "$fh"; # filename
49
    close $fh; # we need just filename
50
    warn "## Name [$opts{Name}] $fh";
51
52
    prFile(\%opts);
46
    bless ($self, $type);
53
    bless ($self, $type);
47
    return $self;
54
    return $self;
48
}
55
}
Lines 52-57 sub End { Link Here
52
    # if the pdf stream is utf8, explicitly set it to utf8; this avoids at lease some wide character errors -chris_n
59
    # if the pdf stream is utf8, explicitly set it to utf8; this avoids at lease some wide character errors -chris_n
53
    utf8::encode($PDF::Reuse::stream) if utf8::is_utf8($PDF::Reuse::stream);
60
    utf8::encode($PDF::Reuse::stream) if utf8::is_utf8($PDF::Reuse::stream);
54
    prEnd();
61
    prEnd();
62
63
    # slurp temporary filename and print it out for plack to pick up
64
    local $/ = undef;
65
    open(my $fh, '<', $self->{filename}) || die "$self->{filename}: $!";
66
    print <$fh>;
67
    close $fh;
68
    unlink $self->{filename};
55
}
69
}
56
70
57
sub Add {
71
sub Add {
58
- 

Return to bug 7952