Ignore:
Timestamp:
2012-04-27T17:13:40+12:00 (12 years ago)
Author:
ak19
Message:

Dr Bainbridge modified gsprintf code to print text containing ampersand, less than and greater then with their entity values instead so that printing to STDERR from BEGIN statements (so far used only in PDFBoxConverter of the PDFBox extension) will play nicely with the XML generated for Pluginfo.pl. Pluginfo.pl has also been modified to use the correct gsprintf printing methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/pdf-box/trunk/java/perllib/plugins/PDFBoxConverter.pm

    r25498 r25500  
    3030use strict;
    3131no strict 'refs'; # allow filehandles to be variables and viceversa
     32no strict 'subs'; # allow barewords (eg STDERR) as function arguments
    3233
    3334use gsprintf 'gsprintf';
     
    5455
    5556    if (!-e $pbajar) {
    56         print STDERR "Failed to find $pbajar\n";
     57        &gsprintf(STDERR,"**** Failed to find $pbajar\n");
    5758        $pdfbox_conversion_available = 0;
    5859        $no_pdfbox_conversion_reason = "gextpdfboxjarnotinstalled";
     
    7879
    7980        if ($status != 0) {
    80         print STDERR "Testing for java\n";
    81         print STDERR "Failed to run: $cmd\n";
    82         print STDERR "$!\n";
     81           
     82        my $error_message =  "**** Testing for java\n";
     83        $error_message .= "Failed to run: $cmd\n";
     84        $error_message .=  "Error variable: |$!| and status: $status\n";
     85
     86        &gsprintf(STDERR, "PDFBoxConverter: $error_message");
     87
    8388        $pdfbox_conversion_available = 0;
    8489        $no_pdfbox_conversion_reason = "couldnotrunjava";
     
    192197
    193198    if ($verbosity>2) {
    194     print $outhandle "Convert command: $convert_cmd\n";
     199    &gsprintf($outhandle,"Convert command: $convert_cmd\n");
    195200    }
    196201
Note: See TracChangeset for help on using the changeset viewer.