Skip Menu |

This queue is for tickets about the HTML-HTMLDoc CPAN distribution.

Report information
The Basics
Id: 79848
Status: open
Priority: 0/
Queue: HTML-HTMLDoc

People
Owner: Nobody in particular
Requestors: RNEWSHAM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.10
Fixed in: (no value)



Subject: No hfimage support
From version 1.8.24 htmldoc has supported multiple header and footer images rather than restricting to a single logo image. There is no interface in HTML::HTMLDoc to make use of this feature. I have added this functionality to my installation. A patch for version 0.10 is attached for anyone that wants to make use of this. Richard Newsham
Subject: HTMLDoc.pm.patch
--- /usr/local/share/perl5/HTML/HTMLDoc.pm 2012-09-25 18:12:18.390281792 +0100 +++ /usr/local/share/perl5/HTML/HTMLDoc.pm.new 2012-09-25 18:20:47.607202353 +0100 @@ -657,6 +657,31 @@ } ############### +# takes an image-filename that is used as hfimageN +# param: imagenumber:INT image:STRING +# return: 1/0 +############### +sub set_hfimage { + my $self = shift; + my $imagenumber = shift; + my $image = shift; + + if ( $imagenumber !~ /^[1..9]$/ ) + { + $self->error("hfimage$imagenumber not supported"); + return 0; + } + + if ( ! -f "$image" ) { + $self->error("hfimage $image could not be found"); + return 0; + } + + $self->_set_doc_config('hfimage'. $imagenumber, $image); + return 1; +} + +############### # returns a previous set logo-image # param: - # return: image:STRING @@ -1329,6 +1354,24 @@ $htmldoc-E<gt>set_logoimage('mylogo.gif'); $htmldoc-E<gt>set_header('.', 'l', '.'); +=head2 set_hfimage($imagenumber, $image) + +Sets the hfimageN for the document where N is defined by $imagenumber and is an integer between 1 and 9. $image is the path to the image in your filesystem. The supported formats are BMP, GIF, JPEG, and PNG. +This is not supported by set_header or set_footer, to use these tags need to be used in the html source e.g. +<!-- HEADER LEFT "$HFIMAGE1" --> +<!-- HEADER CENTER "$HFIMAGE2" --> +<!-- HEADER RIGHT "$HFIMAGE3" --> +<!-- FOOTER LEFT "$HFIMAGE4" --> +<!-- FOOTER CENTER "$HFIMAGE5" --> +<!-- FOOTER RIGHT "$HFIMAGE6" --> + +$htmldoc-E<gt>set_hfimage(1,'headerleft.gif'); +$htmldoc-E<gt>set_hfimage(2,'headercenter.gif'); +$htmldoc-E<gt>set_hfimage(3,'headerright.gif'); +$htmldoc-E<gt>set_hfimage(4,'footerleft.gif'); +$htmldoc-E<gt>set_hfimage(5,'footercenter.gif'); +$htmldoc-E<gt>set_hfimage(6,'footerright.gif'); + =head2 get_logoimage()
That was the wrong patch, here is the correct one.
Subject: HTMLDoc.pm

Message body is not shown because it is too large.

Correction that is the patched module, this is the patch. On Tue Sep 25 18:19:15 2012, RNEWSHAM wrote: Show quoted text
> That was the wrong patch, here is the correct one. >
Subject: HTMLDoc.pm.patch
--- HTML-HTMLDoc-0.10/lib/HTML/HTMLDoc.pm 2005-10-26 09:40:57.000000000 +0100 +++ /usr/local/share/perl5/HTML/HTMLDoc.pm 2012-09-25 23:03:16.498078075 +0100 @@ -657,6 +657,31 @@ } ############### +# takes an image-filename that is used as hfimageN +# param: imagenumber:INT image:STRING +# return: 1/0 +############### +sub set_hfimage { + my $self = shift; + my $imagenumber = shift; + my $image = shift; + + if ( $imagenumber !~ /^[1-9]$/ ) + { + $self->error("hfimage$imagenumber not supported"); + return 0; + } + + if ( ! -f "$image" ) { + $self->error("hfimage $image could not be found"); + return 0; + } + + $self->_set_doc_config('hfimage'. $imagenumber, $image); + return 1; +} + +############### # returns a previous set logo-image # param: - # return: image:STRING @@ -1329,6 +1354,24 @@ $htmldoc-E<gt>set_logoimage('mylogo.gif'); $htmldoc-E<gt>set_header('.', 'l', '.'); +=head2 set_hfimage($imagenumber, $image) + +Sets the hfimageN for the document where N is defined by $imagenumber and is an integer between 1 and 9. $image is the path to the image in your filesystem. The supported formats are BMP, GIF, JPEG, and PNG. +This is not supported by set_header or set_footer, to use these tags need to be used in the html source e.g. +<!-- HEADER LEFT "$HFIMAGE1" --> +<!-- HEADER CENTER "$HFIMAGE2" --> +<!-- HEADER RIGHT "$HFIMAGE3" --> +<!-- FOOTER LEFT "$HFIMAGE4" --> +<!-- FOOTER CENTER "$HFIMAGE5" --> +<!-- FOOTER RIGHT "$HFIMAGE6" --> + +$htmldoc-E<gt>set_hfimage(1,'headerleft.gif'); +$htmldoc-E<gt>set_hfimage(2,'headercenter.gif'); +$htmldoc-E<gt>set_hfimage(3,'headerright.gif'); +$htmldoc-E<gt>set_hfimage(4,'footerleft.gif'); +$htmldoc-E<gt>set_hfimage(5,'footercenter.gif'); +$htmldoc-E<gt>set_hfimage(6,'footerright.gif'); + =head2 get_logoimage()