Skip to content

Latest commit

 

History

History
26 lines (23 loc) · 1.66 KB

README.md

File metadata and controls

26 lines (23 loc) · 1.66 KB

pdf2txt-google

In order to use this converter, you will need to have a Google Cloud project configured with the Cloud Vision API and Cloud Storage API. You will also need a cloud storage bucket. The application must have the credentials needed to access the project. These are usually provided in a JSON file that contains fields for project_id and private_key_id among others. The location of the file is specified in pdf2txt.conf and defaults to ${user.home}/.pdf2txt/google-credentials.json. However, the value can be overridden with the environment variable GOOGLE_APPLICATION_CREDENTIALS. If need be, you can change the value recorded in the configuration file or just specify a different configuration file (e.g., as a command line argument to pdf2txt) that contains a different value for Pdf2txt.google.credentials. Also recorded in the configuration file is the name of the storage bucket. It defaults to pdf2txt_pdfs and can be overridden with the environment variable Pdf2txt_google_bucket. Below are example contents of the files.

pdf2txt.conf:

Pdf2txt {
  google {
    credentials = ${user.home}/.pdf2txt/google-credentials.json
    credentials = ${?GOOGLE_APPLICATION_CREDENTIALS}
    bucket = "pdf2txt_pdfs"
    bucket = ${?Pdf2txt_google_bucket}
  }
}

google-credentials.json:

{
  "type": "...",
  "project_id": "...",
  "private_key_id": "...",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
  ...
}