根据文档here,OCR是在上传到Google云端硬盘的.jpg,.png,.gif或.pdf文件上执行的。并且here indexableText
似乎指出了可以访问OCR文本的可能性。
但是,我似乎无法做到 - 文件上的GET
请求未显示indexableText
,并且似乎没有任何帮助。
任何提示?
如果你想要一个片段,我在这里做什么(perl)
my $ua = Mojo::UserAgent::Google->new({ token => $c->session('token') }); # set useragent
my $url = Mojo::URL->new('https://www.googleapis.com/drive/v2/files');
push @{$url->path}, ($id); # URL including file ID
$url->query({ fields => '*' }); # and query for all fields
my $tx = $ua->get($url); # send a get request
$c->render(json => $tx->res->json); # and render the response as JSON
响应中不包含任何看起来像OCR文本的内容。