Changeset 32273 for main/trunk/greenstone2/perllib/plugins/PDFPlugin.pm
- Timestamp:
- 2018-07-13T20:40:24+12:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/PDFPlugin.pm
r32224 r32273 140 140 $self->{'file_type'} = "PDF"; 141 141 142 # PDFPlugin is deprecated and migrating users should hereafter choose between 143 # PDFv1Plugin, if they want to use the old pdftohtml tool's capabilities, 144 # and PDFv2Plugin, if they want to use pdfbox or the new xpdftools capabilities. 145 &gsprintf::gsprintf(STDERR, "{PDFPlugin.deprecated_plugin}"); 146 142 147 # these are passed through to gsConvert.pl by ConvertBinaryFile.pm 143 148 my $zoom = $self->{"zoom"}; 144 $self->{'convert_options'} = "-pdf_zoom $zoom"; 149 # By default, PDFPlugin assumes gsConvert.pl will run the old pdftohtml conversion tool, 150 # But if pdfbox conversion is turned on, the tool used is pdfbox (which is presently an 151 # AutoLoadConverter and therefore bypasses gsConvert.pl) 152 $self->{'convert_options'} = "-pdf_tool pdftohtml"; 153 $self->{'convert_options'} .= " -pdf_zoom $zoom"; 145 154 $self->{'convert_options'} .= " -pdf_complex" if $self->{"complex"}; 146 155 $self->{'convert_options'} .= " -pdf_nohidden" if $self->{"nohidden"}; … … 151 160 # TODO: Start supporting PDF to txt on Windows if we're going to be using XPDF Tools (incl pdftotext) on Windows/Linux/Mac 152 161 if ($self->{'convert_to'} eq "text" && $ENV{'GSDLOS'} =~ /^windows$/i) { 153 154 #print STDERR "Windows does not support pdf to text. PDFs will be converted to HTML instead\n";155 #$self->{'convert_to'} = "html";162 #print STDERR "On Windows, Greenstone now uses Xpdf tools to support pdf to text conversion.\n"; 163 print STDERR "Windows does not support pdf to text. PDFs will be converted to HTML instead\n"; 164 $self->{'convert_to'} = "html"; 156 165 } 157 166 elsif ($self->{'convert_to'} eq "auto") { … … 407 416 # Copying file open/close code from CommonUtil::utf8_write_file() 408 417 if (!open (OUTFILE, ">:utf8", $output_filename)) { 409 gsprintf(STDERR, "PDFPlugin::xpdftohtml_convert_post_process {Co nvertToPlug.could_not_open_for_writing} ($!)\n", $output_filename);418 gsprintf(STDERR, "PDFPlugin::xpdftohtml_convert_post_process {CommonUtil.could_not_open_for_writing} ($!)\n", $output_filename); 410 419 die "\n"; 411 420 }
Note:
See TracChangeset
for help on using the changeset viewer.