Ignore:
Timestamp:
2005-07-06T15:27:45+12:00 (19 years ago)
Author:
kjdon
Message:

Jeffrey's new parsing modifications, committed approx 6 July, 15.16

File:
1 edited

Legend:

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

    r9465 r10218  
    7070
    7171sub new {
    72     my $class = shift (@_);
    73 
    74     my ($noimages, $complex, $zoom, $use_sections, $nohidden);
    75 
    76     my @args=@_;
    77 
    78     if (!parsargv::parse(\@_,
    79              q^noimages^, \$noimages,
    80              q^complex^, \$complex,
    81              q^zoom/\d+/2^, \$zoom,
    82              q^nohidden^, \$nohidden,
    83              q^use_sections^, \$use_sections,
    84              "allow_extra_options")) {
    85 
    86     my $self = new ConvertToPlug($class, @_);
    87     my $outhandle=$self->{'outhandle'};
    88     print $outhandle "\nIncorrect options passed to PDFPlug, check your collect.cfg configuration file\n";
    89     $self->print_txt_usage("");  # Use default resource bundle
    90     exit 1;
    91     }
    92 
    93 
    94     if ($use_sections) {
    95     push (@args, "-description_tags");
    96     }
    97 
    98     # following title_sub removes "Page 1" added by pdftohtml, and a leading
    99     # "1", which is often the page number at the top of the page. Bad Luck
    100     # if your document title actually starts with "1 " - is there a better way?
    101 
    102     my $self = new ConvertToPlug ($class, @args, "-title_sub", '^(Page\s+\d+)?(\s*1\s+)?');
    103     $self->{'plugin_type'} = "PDFPlug";
    104     if ($use_sections) {
    105     $self->{'use_sections'}=1;
    106     }
    107 
    108     # 14-05-02 To allow for proper inheritance of arguments - John Thompson
    109     my $option_list = $self->{'option_list'};
    110     push( @{$option_list}, $options );
     72    my ($class) = shift (@_);
     73    my ($pluginlist,$inputargs,$hashArgOptLists) = @_;
     74    push(@$pluginlist, $class);
     75
     76    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
     77    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
     78
     79    push(@$inputargs,"-title_sub");
     80    push(@$inputargs,'^(Page\s+\d+)?(\s*1\s+)?');
     81
     82    my $self = (defined $hashArgOptLists)? new ConvertToPlug($pluginlist,$inputargs,$hashArgOptLists): new ConvertToPlug($pluginlist,$inputargs);
     83
     84
     85    if ($self->{"use_sections"}) {
     86    $self->{"description_tags"} = 1;
     87    }
    11188
    11289    # these are passed through to gsConvert.pl by ConvertToPlug.pm
     90    my $zoom = $self->{"zoom"};
    11391    $self->{'convert_options'} = "-pdf_zoom $zoom";
    114     $self->{'convert_options'} .= " -pdf_complex" if $complex;
    115     $self->{'convert_options'} .= " -pdf_nohidden" if $nohidden;
    116     $self->{'convert_options'} .= " -pdf_ignore_images" if $noimages;
     92    $self->{'convert_options'} .= " -pdf_complex" if $self->{"complex"};
     93    $self->{'convert_options'} .= " -pdf_nohidden" if $self->{"nohidden"};
     94    $self->{'convert_options'} .= " -pdf_ignore_images" if $self->{"noimages"};
    11795
    11896    # pdftohtml will always produce html files encoded as utf-8
Note: See TracChangeset for help on using the changeset viewer.