Skip Menu |

This queue is for tickets about the PDF-Create CPAN distribution.

Report information
The Basics
Id: 118764
Status: resolved
Priority: 0/
Queue: PDF-Create

People
Owner: MANWAR [...] cpan.org
Requestors: andy [...] andybev.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.35
Fixed in: 1.36



Subject: File not closed when specifying handle instead of name
Date: Mon, 14 Nov 2016 18:25:52 +0000
To: bug-PDF-Create [...] rt.cpan.org
From: Andrew Beverley <andy [...] andybev.com>
When specifying a file handle instead of file name: my $pdf = PDF::Create->new( fh => $fh, Author => 'John Doe', Title => 'Sample PDF', CreationDate => [ localtime ] ); the file is not closed properly and is therefore corrupt. This is the fix: --- a/lib/PDF/Create.pm +++ b/lib/PDF/Create.pm @@ -557,7 +557,7 @@ sub close { $self->add_info; $self->add_crossrefsection; $self->add_trailer; - $self->{'fh'}->close if defined $self->{'fh'} && defined $self->{'filename'}; + $self->{'fh'}->close if defined $self->{'fh'}; $self->{'data'}; } Thanks, Andy
Hi Andy, Thanks for raising the issue and providing the patch as well, much appreciated. I will get it patched asap. Best Regards, Mohammad S Anwar
Subject: Re: [rt.cpan.org #118764] File not closed when specifying handle instead of name
Date: Tue, 15 Nov 2016 06:06:42 +0000
To: bug-PDF-Create [...] rt.cpan.org
From: Andrew Beverley <andy [...] andybev.com>
Show quoted text
> I will get it patched asap.
Brilliant, thanks Mohammad, really appreciate it.
Resolved.