Relying on google translate...  I'm not sure how protection could lead to 
garbled text; if the file is password protected, you shouldn't get any text.


Try troubleshooting with pure PDFBox:

https://wiki.apache.org/tika/Troubleshooting%20Tika#PDF_Text_Problems


-----Original Message-----
From: question.answer...@gmail.com [mailto:question.answer...@gmail.com] 
Sent: Wednesday, September 14, 2016 7:22 AM
To: user@tika.apache.org
Subject: Apache Tikaで、保護されたPDFを取り込むと全文が文字化けしている

皆様、始めまして。

Tika初心者です。

いきなりですが、表記件についてご質問させてください。

Apache Tikaで、保護されたPDFを取り込むと全文が文字化けしているのですが、
これは、仕様でしょうか?
設定などで回避して文字化けなしで取り込む方法はありますでしょうか?
  ※保護されていないPDFは、文字化けなく、取り込めます。

原因は何で、対応策(Tikaへの設定?など)は、ありますでしょうか?


ソース:
-----------------------------------------------------
File document = new File("/usr/local/sample.pdf"); Parser parser = new 
AutoDetectParser(); ContentHandler handler = new 
BodyContentHandler(Integer.MAX_VALUE);
Metadata metadata = new Metadata();
parser.parse(new FileInputStream(document), handler, metadata
                                                                         , new 
ParseContext()); String plainText = handler.toString(); 
System.out.println(plainText);
-----------------------------------------------------


補足:
・保護されたPDFは、手動でテキストのコピーができない。


Tika初心者

Reply via email to