2016-07-03 7 views
0

Googleドライブに保存されているPDFドキュメントがあります。 Google Drive Web UI検索を使用して、ドキュメント内のテキストを見つけることができます。GoogleでPDFからテキストを取得

Google Apps Scriptを使用して、ドキュメント内のテキストの一部をプログラムで抽出するにはどうすればよいですか?

+0

http://stackoverflow.com/questions/23771146/google-drive-php-api-how-to-stream-a-large-file –

答えて

0

pdfToText()this gistで参照してください。

Googleドライブに組み込まれているOCRをPDFファイルで呼び出すには、次のようにします。 myPDF.pdf、ここにあなたが何をすべきかです:

function myFunction() { 
    var pdfFile = DriveApp.getFilesByName("myPDF.pdf").next(); 
    var blob = pdfFile.getBlob(); 

    // Get the text from pdf 
    var filetext = pdfToText(blob, {keepTextfile: false}); 

    // Now do whatever you want with filetext... 
} 
関連する問題