Changeset 10724


Ignore:
Timestamp:
2005-10-14T13:37:43+13:00 (19 years ago)
Author:
chi
Message:

Add an option-metadata_fields to allow user-specified metadata fields to be extracted from PDF document.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/PDFPlug.pm

    r10580 r10724  
    6767    'type' => "regexp",
    6868    'deft' => &get_default_block_exp() },
    69       { 'name' => "noimages",
    70     'desc' => "{PDFPlug.noimages}",
     69       { 'name' => "metadata_fields",
     70     'type' => "string",
     71     'deft' => "" },
     72       { 'name' => "noimages",
     73     'desc' => "{PDFPlug.noimages}",
    7174    'type' => "flag" },
    7275      { 'name' => "allowimagesonly",
     
    156159    # Instruct HTMLPlug (when eventually accessed through read_into_doc_obj)
    157160    # to extract these metadata fields from the HEAD META fields
    158     push(@$html_options,"-metadata_fields","Title,GENERATOR,date,author<Creator>");
    159    
     161    my $required_metadata;
     162    if (defined $self->{'metadata_fields'} && $self->{'metadata_fields'} =~ /\S/) {
     163    push(@$html_options,"-metadata_fields",$self->{'metadata_fields'});
     164    } else {
     165    push(@$html_options,"-metadata_fields","Title,GENERATOR,date,author<Creator>");
     166    }
     167    #push(@$html_options,"-metadata_fields","Title,GENERATOR,date,author<Creator>");
     168       
    160169    if ($self->{'use_sections'} || $self->{'description_tags'}) {
    161170    $self->{'description_tags'} = 1;
     
    287296    # and fix the capitalisation of 'date'
    288297    my $cursection = $doc_obj->get_top_section();
    289 
    290298    foreach my $datemeta (@{$doc_obj->get_metadata($cursection, "date")}) {
    291299    $doc_obj->delete_metadata($cursection, "date", $datemeta);
Note: See TracChangeset for help on using the changeset viewer.