Subject: | Win32, binmode() needed |
XML-Handler-AxPoint-1.30, Windows 2000
using axpoint (the command line tool) produces broken PDFs, because the
file is opened in text mode; patch below cures this; also fixes a warning
when <email> is not present.
Regards
Mattia
--- lib\XML\Handler\AxPoint.pm.orig Tue Jun 11 09:39:24 2002
+++ lib\XML\Handler\AxPoint.pm Tue Jul 02 10:42:04 2002
@@ -42,5 +42,11 @@
}
elsif (not $ref) {
- $self->{Consumer} = XML::SAX::Writer::FileConsumer->new($self->{Output});
+ local *FH;
+
+ open FH, '> ' . $self->{Output} or
+ XML::SAX::Writer::Exception->throw( Message => "Error opening '" .
+ $self->{Output} . "': $!" );
+ binmode FH;
+ $self->{Consumer} = XML::SAX::Writer::HandleConsumer->new(*FH);
}
elsif (UNIVERSAL::can($self->{Output}, 'output')) {
@@ -317,5 +323,6 @@
if ($self->{metadata}{speaker}) {
$self->{pdf}->add_link(link => "mailto:" . $self->{metadata}{email},
- x => 20, y => $y - 10, w => 570, h => 24);
+ x => 20, y => $y - 10, w => 570, h => 24)
+ if defined $self->{metadata}{email};
$self->{pdf}->print_boxed($self->{metadata}{speaker},
x => 20, y => 40, w => 570, h => $y - 24, mode => "center");