Namazu-devel-ja(旧)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PDF ファイルをページごとに分割



岡埜です
肝心の部分が抜けていました
mknmz:
sub process_file ($$$$$$){
  省略
  if ($var::Opt{'htmlsplit'} && $cfile =~ $conf::HTML_SUFFIX){
    html分割用の処理
  }
  if ($var::Opt{'pdfsplit'} && $cfile =~ $conf::PDF_SUFFIX){
    my @parts = pdfsplit::split($cfile, "NMZ.partial");
    if (@parts > 1){
      my $id = 0;
      for my $part (@parts){
        my $fname = util::tmpnam("NMZ.partial.$id");
        my $fragment  = defined $part ? "page=$part" : undef;
        my $uri   = generate_uri($cfile, $fragment);
        my $result = namazu_core($fname, 
               $docid_count + $processed_num, 
               $docid_base, $file_count, 
               $field_indices, $fh_errorsfile, 
               $total_files_num, 
               $uri, $id, $#parts);
        if ($result > 0){
          $processed_num++;
          my $rname = defined $part ? "$cfile\t$part" : "$cfile";
          put_registry($rname);
        }
        unlink $fname;
        $id++;
      }
      return ($file_size, $processed_num);
    }
  }
  省略
}