Changeset 7019
- Timestamp:
- 2004-03-11T12:32:01+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/PDFPlug.pm
r6408 r7019 80 80 "allow_extra_options")) { 81 81 82 print STDERR "\nIncorrect options passed to PDFPlug, check your collect.cfg configuration file\n";83 82 local $self = new ConvertToPlug($class, @_, "-title_sub", '^(Page\s+\d+)?(\s*1\s+)?'); 83 my $outhandle=$self->{'outhandle'}; 84 print $outhandle "\nIncorrect options passed to PDFPlug, check your collect.cfg configuration file\n"; 84 85 $self->print_txt_usage(""); # Use default resource bundle 85 die "\n";86 exit 1; 86 87 } 87 88 … … 158 159 sub process { 159 160 my $self = shift (@_); 161 my $outhandle=$self->{'outhandle'}; 162 160 163 if ($self->{'use_sections'} 161 164 && $self->{'converted_to'} eq "HTML") { 162 165 163 print STDERR"PDFPlug: Calculating sections...\n";166 print $outhandle "PDFPlug: Calculating sections...\n"; 164 167 my $textref=$_[0]; 165 168 … … 167 170 my @sections = split('<a name=', $$textref); 168 171 169 shift @sections; # don't need HTML header, etc 172 if (scalar (@sections) == 1) { #only one section - no split! 173 print $outhandle "PDFPlug: warning - no sections found\n"; 174 } else { 175 shift @sections; # don't need HTML header, etc 176 } 177 170 178 # handle first section specially for title? Or all use first 100... 171 179 … … 183 191 $title =~ s/\s\S*$/.../; 184 192 185 my $top_section = "<!--<Section>\n<Metadata name=\"Title\">$title</Metadata>\n-->\n <!--</Section>-->\n"; 193 my $top_section; 194 if (scalar (@sections) == 1) { # no sections found 195 $top_section=$sections[0]; 196 @sections=(); 197 } else { 198 $top_section = "<!--<Section>\n<Metadata name=\"Title\">$title</Metadata>\n-->\n <!--</Section>-->\n"; 199 } 186 200 187 201 # add metadata per section... … … 204 218 } 205 219 206 my $outhandle = $self->{'outhandle'};207 220 print $outhandle "PDFPlug: passing $_[3] on to $self->{'converted_to'}Plug\n" 208 221 if $self->{'verbosity'} > 1;
Note:
See TracChangeset
for help on using the changeset viewer.