I have a lot of research papers in my google drive. They are all in PDF format. To better manage this large collection of papers (>1k), I want to make a simple table (a Google sheet), in which I would like to have the titles (not file names) and other metadata (e.g. year of publication, authors, etc.) of the PDFs with their corresponding URLs on Google drive.

Using Google Apps Script, I can get the URLs of all the PDFs without breaking sweat. However, getting the titles of the PDFs seems to be a difficult task. I wonder if there is any solution for this that uses Google Apps Script or some other approach.

One possible solution would involve patching together different APIs. I am thinking that getting the titles of the PDFs would be possible by (1) first taking few lines from the 1st page of the PDF, (2) searching them over the Google using Google search API. This should give me the title of the PDF, but not always. Once I have the title then, I could (3) get the metadata of the PDF using APIs of databases such as PubMed or Crossref. This is a kind of solution that is not going to work for all the PDFs. I wonder if there is any existing solution for this that might work better than the solution I am thinking of.

  • What exactly do you mean by title? Are you referring to the file name? if that is the case just use the getName() method of Class File. By the other hand have you already tried the Google Drive advanced service? In either case, please show what you tried. and add a brief description of your search efforts as is suggested in How to Ask. Also please be more specific about what other metadata you want to get.
    – Rubén
    Aug 17, 2021 at 20:29
  • I did not mean the file name but the the title of the document. In a typical research paper, it is commonly located at the top of the first page.
    – user345394
    Aug 18, 2021 at 0:46
  • Thanks for the clarification but the question doesn't look to be good fit for this site, for one side because questions about APIs are off-topic an by the other because the question needs more focus.
    – Rubén
    Aug 18, 2021 at 2:03
  • Thinking out loud... What if one imported a pdf into Google Docs? Would there be consistent parameter(s) to identify and capture the Title? If answer is yes, then an apps script might be a solution. There are solutions for this scenario. To name one Yagisanatode has a post Google Apps Script: Extract Specific Data From a PDF and insert it into a Google Sheet. Have you researched these alternatives?
    – Tedinoz
    Sep 20, 2021 at 3:44


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.