despite what the docco suggests.
I've added a bunch of the TWiki::UI::View::view template code in to make it work,but it sure looks like more work is going to be needed.
--
TWiki:Main/SvenDowideit - 03 Jun 2008
unfinished patch:
Index: lib/TWiki/Contrib/GenPDF.pm
===================================================================
--- lib/TWiki/Contrib/GenPDF.pm (revision 364)
+++ lib/TWiki/Contrib/GenPDF.pm (working copy)
@@ -110,8 +110,43 @@
if $prefs{'recursive'}; # no point spoiling _everything_
TWiki::Func::redirectCgiQuery($query, $text);
}
+
+ my $session = $TWiki::Plugins::SESSION;
+ my $tmpl = $session->templates->readTemplate( 'view', $prefs{'skin'} ) || $prefs{'skin'}.'%TEXT%';
+ my( $start, $end );
+ if( $tmpl =~ m/^(.*)%TEXT%(.*)$/s ) {
+ my @starts = split( /%STARTTEXT%/, $1 );
+ if ( $#starts > 0 ) {
+ # we know that there is something before %STARTTEXT%
+ $start = $starts[0];
+ $text = $starts[1] . $text;
+ } else {
+ $start = $1;
+ }
+ my @ends = split( /%ENDTEXT%/, $2 );
+ if ( $#ends > 0 ) {
+ # we know that there is something after %ENDTEXT%
+ $text .= $ends[0];
+ $end = $ends[1];
+ } else {
+ $end = $2;
+ }
+ } else {
+ my @starts = split( /%STARTTEXT%/, $tmpl );
+ if ( $#starts > 0 ) {
+ # we know that there is something before %STARTTEXT%
+ $start = $starts[0];
+ $text = $starts[1];
+ } else {
+ $start = $tmpl;
+ $text = '';
+ }
+ $end = '';
+ }
+
+
$text =~ s/\%TOC({.*?})?\%//g; # remove TWiki TOC
- $text = TWiki::Func::expandCommonVariables($text, $topic, $webName);
+ $text = TWiki::Func::expandCommonVariables($start.$text.$end, $topic, $webName);
$text = TWiki::Func::renderText($text);
return $text;
--
TWiki:Main.SvenDowideit - 03 Jun 2008