Changeset 11008 for trunk/gsdl


Ignore:
Timestamp:
2005-12-19T15:17:49+13:00 (18 years ago)
Author:
mdewsnip
Message:

Added an option to run the "fribidi" Unicode Bidirectional Algorithm program over the converted file, primarily to fix up right-to-left PDFs that pdftohtml can't handle.

Location:
trunk/gsdl/perllib
Files:
2 edited

Legend:

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

    r10994 r11008  
    6767    #'type' => "regexp",
    6868    'deft' => "" },
     69      { 'name' => "apply_fribidi",
     70    'desc' => "{ConvertToPlug.apply_fribidi}",
     71    'type' => "flag",
     72    'reqd' => "no" },
    6973      { 'name' => "use_strings",
    7074    'desc' => "{ConvertToPlug.use_strings}",
     
    345349    $self->{'conv_filename'} = $conv_filename;
    346350    $self->convert_post_process($conv_filename);
    347    
     351
     352    # Run the "fribidi" (http://fribidi.org) Unicode Bidirectional Algorithm program over the converted file
     353    # Added for fixing up Persian PDFs after being processed by pdftohtml, but may be useful in other cases too
     354    if ($self->{'apply_fribidi'} && $self->{'converted_to'} =~ /(HTML|TEXT)/) {
     355    my $fribidi_command = "fribidi \"$conv_filename\" >\"${conv_filename}.tmp\"";
     356    if (system($fribidi_command) != 0) {
     357        print STDERR "ERROR: Cannot run fribidi on \"$conv_filename\".\n";
     358    }
     359    else {
     360        &util::mv("${conv_filename}.tmp", $conv_filename);
     361    }   
     362    }
     363
    348364    my $secondary_plugins =  $self->{'secondary_plugins'};
    349365    my $num_secondary_plugins = scalar(keys %$secondary_plugins);
  • trunk/gsdl/perllib/strings.rb

    r10998 r11008  
    621621BRSPlug.desc: BRSPlug deals with the BBC collections. There are three BBC collections we deliver, which are National Sound Archive (nsa), British Film Institute (bfi), and BBC Other (bbcother) (everything does not fit into one of the first two). Four options are provided which are all-build all collections, nsa-build the NSA collections, bfi-build the BFI collections, bbcother-build the OTHER collections.
    622622
     623ConvertToPlug.apply_fribidi:Run the "fribidi" Unicode Bidirectional Algorithm program over the converted file (for right-to-left text).
    623624ConvertToPlug.convert_to:Plugin converts to TEXT or HTML or various types of Image (e.g. JPEG, GIF, PNG).
    624625ConvertToPlug.convert_to.auto:Automatically select the format converted too.  Format chosen depends on input document type, for example Word will automatically be converted to HTML, whereas PowerPoint will be converted to Greenstone's PagedImage format.
Note: See TracChangeset for help on using the changeset viewer.