Changeset 32207

Show
Ignore:
Timestamp:
25.06.2018 16:51:57 (3 months ago)
Author:
ak19
Message:

Got a basic Windows version of PDFPlugin's new paged_html mode working

Location:
main/trunk
Files:
359 added
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/gsConvert.pl

    r32205 r32207  
    848848    my $xpdf_pdftohtml = &FileUtils::filenameConcatenate($ENV{'GSDLHOME'}, "bin", $ENV{'GSDLOS'}, "xpdf-tools"); 
    849849 
    850     if ($ENV{'GSDLOS'} =~ m/^windows$/i) { 
     850    if ($ENV{'GSDLOS'} =~ m/^darwin$/i) { 
    851851    # TODO 
    852     } elsif ($ENV{'GSDLOS'} =~ m/^darwin$/i) { 
    853     # TODO 
    854     } else { # unix, use the appropriate bin folder for the bitness of the system 
    855  
     852    } else { # unix or windows, use the appropriate bin folder for the bitness of the system 
     853        # In fact, when testing 3 different PDF docs, it doesn't seem to make a difference on 
     854        # 64 bit Windows whether the pdftohtml binary in the bin32 or bin64 folder is used. 
     855        # However, maybe we'll use another xpdf-tool too in future where bitness will be relevant. 
     856     
    856857    # Don't use $ENV{'GSDLARCH'}, use the new $ENV{'BITNESS'}, since 
    857858    # $ENV{'GSDLARCH'} is only (meant to be) set when many other 32-bit or 64-bit 
     
    866867    } 
    867868 
     869    #print STDERR "@@@@ BITNESS: " . $ENV{'BITNESS'} . "\n"; 
     870     
    868871    # We'll create the file by name $output_filestem during post-conversion processing. 
    869872    # Note that Xpdf tools will only create its conversion products in a dir that does 
  • main/trunk/greenstone2/setup.bat

    r31990 r32207  
    245245 
    246246:done 
     247 
     248:: Want to know bitness of machine for working out whether to use xpdftools' bin32 or 
     249::   bin64 directory to run Xpdf's pdftohtml. 
     250:: Googled: determine bit architecture windows command line 
     251::   techgenix.com/aquicktiptocheckoperatingsystemarchitecture/ 
     252::   'Type "SET Processor" (without double quotes) 
     253::   You will see the output SIMILAR to below [among OTHER lines of output]: 
     254::   PROCESSOR_ARCHITECTURE=x86 
     255::   OR 
     256::   PROCESSOR_ARCHITECTURE=x64.' 
     257::   (In my case PROCESSOR_ARCHITECTURE=AMD64) 
     258:: The following runs the cmd "set Processor". Then, among the multiline output, it finds the line 
     259::   containing "PROCESSOR_ARCHITECTURE", splits this line on the delimiter "=" and stores the 2nd token in %%G 
     260::   Based on the example "_ping_cmd" at https://ss64.com/nt/for_cmd.html 
     261for /f "tokens=2 delims==" %%G in ('set Processor ^|find "PROCESSOR_ARCHITECTURE"') do set BITNESS=%%G 
     262rem echo Processor architecture is %BITNESS% 
     263::   which will be something like "amd64" or "x64", or "x86" for 32 bit 
     264:: From https://ss64.com/nt/syntax-substring.html 
     265::   "To do a string comparison, remove the SearchString and compare the result with the original 
     266::   variable before removal. If both strings are the same, then SearchString was not found:" 
     267rem set example=amd64 
     268rem IF /i "%example:64=%" == "%example%" (echo Not 64 bit) ELSE (echo 64 bit) 
     269if /i "%BITNESS:64=%" == "%BITNESS%" (set BITNESS=32) else (set BITNESS=64) 
     270echo Bitness of machine: %BITNESS% 
     271 
     272 
    247273popd 
    248 endlocal & set PATH=%PATH%& set GSDLHOME=%GSDLHOME%& set GSDLOS=%GSDLOS%& set JRE_HOME=%JRE_HOME%& set JAVA_HOME=%JAVA_HOME% 
     274endlocal & set PATH=%PATH%& set GSDLHOME=%GSDLHOME%& set GSDLOS=%GSDLOS%& set JRE_HOME=%JRE_HOME%& set JAVA_HOME=%JAVA_HOME%& set BITNESS=%BITNESS% 
    249275 
    250276if not "%JAVA_HOME%" == "" echo JAVA_HOME: %JAVA_HOME%