Changeset 24476 for main/trunk
- Timestamp:
- 2011-08-25T19:33:02+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/PDFPlugin.pm
r24431 r24476 285 285 # embeds each page in an extra div. The div opener is: 286 286 # <div style=\"page-break-before:always; page-break-after:always\"> 287 # The PDFPlugin now looks for this and prefix <a name=0></a> to each such div. (The287 # The PDFPlugin now looks for this and prefixes <a name=0></a> to each such div. (The 288 288 # pagenumber is fixed at 0 since I'm unable to work out how to increment the pagenum during 289 289 # a regex substitution even with regex extensions on.) Later, when we process each section … … 299 299 # for each page). Metadata based on this calculation not set until process() 300 300 # 301 # Note: this is done even if we are not breaking t odocument into pages as it might301 # Note: this is done even if we are not breaking the document into pages as it might 302 302 # be useful to give an indication of document length in browser through setting 303 303 # num_pages as metadata. 304 my @pages = ($text =~ m/ (\<[Aa] name=\"?\w+\"?>|\<div style=\"page-break-before:always; page-break-after:always\">)/ig); #<div style=\"?page-break-before:always; page-break-after:always\"?>304 my @pages = ($text =~ m/\<[Aa] name=\"?\w+\"?>/ig); #<div style=\"?page-break-before:always; page-break-after:always\"?> 305 305 my $num_pages = scalar(@pages); 306 306 $self->{'num_pages'} = $num_pages; … … 422 422 } 423 423 424 $doc_obj->add_utf8_metadata($cursection, "NumPages", $self->{'num_pages'}) ;424 $doc_obj->add_utf8_metadata($cursection, "NumPages", $self->{'num_pages'}) if defined $self->{'num_pages'}; 425 425 426 426 if ($self->{'use_sections'} && $self->{'converted_to'} eq "HTML") {
Note:
See TracChangeset
for help on using the changeset viewer.