0
$\begingroup$

I'm trying to extract paragraphs from 230 pdfs that have similar formats, and then label the paragraphs based on the pdf's section headings. Normally, I'd convert the pdf to txt files or extract the text using pdftools on R, but this would prevent me from distinguishing the text in headings -- which is bold, has a certain color -- from the text in the body that I want to "tag". I have access to Adobe Acrobat Pro, so I can convert the pdfs to .txt, .xml, .html, .rtf, or .docx files.

  1. Does anyone have any suggestions on the best way to proceed?
  2. If there isn't a straightforward answer to the first question, is there one file format among the ones listed above (aside from .txt, which would strip the formatting) that would be easier to parse than others?

Thanks!

$\endgroup$
0
$\begingroup$

Since the main goal is to extract headers(which has different characteristics from other text). It would be best to convert pdf to xml as you will get features like style,hpos,vpos for each text in the file.

To work with xml you can refer ElemenTree.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.