如何使用 Google 的 Vision API 将 PDF(不可搜索)转换为可搜索 PDF?

How do I use Google's Vision API to convert a PDF (non-searchable) to a searchable PDF?

据我所知,Google 的 Vision API 允许您在 PDF 上执行 OCR,但它 returns 仅检测到的文本 格式为 JSON。我需要的是 return 中的可搜索 (OCR) PDF 文件。这可能吗?

请注意 OutputConfig type doesn't have any metadata field to configure the resulting file's format. As you are already aware, the API returns a JSON response. You could either first get the JSON data with the API and explore the use of any of the following repositories for JSON to PDF conversion or directly use any specialized module such as OCRmyPDF 在您的源 PDF 上专门用于此目的,并完全避免使用 API。