diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-02 02:29:02 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-02 02:29:02 +0000 |
commit | 6de6d2b0d356a0e40b8c45690557936a402ba908 (patch) | |
tree | bb3727c8c560d6de4a90c404c76d351852baa855 | |
parent | 809285b31bbc0ff8c683d04ddd9e45503eea1246 (diff) |
Some changes that may improve PDF output
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1497 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-x | LedgerSMB/Template.pm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/LedgerSMB/Template.pm b/LedgerSMB/Template.pm index ba2cd221..90db6097 100755 --- a/LedgerSMB/Template.pm +++ b/LedgerSMB/Template.pm @@ -144,18 +144,22 @@ sub _http_output { my $self = shift; my $FH; - print STDERR "Content-Type: $self->{mimetype}; charset=utf-8\n\n"; if ($self->{mimetype} =~ /^text/) { print "Content-Type: $self->{mimetype}; charset=utf-8\n\n"; } else { print "Content-Type: $self->{mimetype}\n\n"; } - open($FH, '<', $self->{rendered}) or + open($FH, '<:bytes', $self->{rendered}) or throw Error::Simple 'Unable to open rendered file'; - while (<$FH>) { - print $_; + my $data; + { + local $/; + $data = <$FH>; } close($FH); + binmode STDOUT, ':bytes'; + print $data; + binmode STDOUT, ':utf8'; unlink($self->{rendered}) or throw Error::Simple 'Unable to delete output file'; exit; |