[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1497] trunk/LedgerSMB/Template.pm



Revision: 1497
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1497&view=rev
Author:   tetragon
Date:     2007-09-01 19:29:02 -0700 (Sat, 01 Sep 2007)

Log Message:
-----------
Some changes that may improve PDF output

Modified Paths:
--------------
    trunk/LedgerSMB/Template.pm

Modified: trunk/LedgerSMB/Template.pm
===================================================================
--- trunk/LedgerSMB/Template.pm	2007-09-02 01:42:12 UTC (rev 1496)
+++ trunk/LedgerSMB/Template.pm	2007-09-02 02:29:02 UTC (rev 1497)
@@ -144,18 +144,22 @@
 	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;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.