<p><strong>JUNE 2021 UPDATED ANSWER</strong></p>
<p>I think this question needs an updated answer.</p>
<p><strong>GOOD NEWS</strong>: The R package <code>pdftools</code> has included in its recent update the option to extract <code>font-data</code> from the pdfs. The function <code>pdf_data</code> has now an additional argument <code>font_info</code> described in the <a href="https://github.com/ropensci/pdftools/blob/master/man/pdftools.Rd" rel="nofollow noreferrer">documentation</a>:</p>
<blockquote>
<p><strong>font_info</strong> if TRUE, extract font-data for each box. Be careful, this
requires a very recent version of poppler and will error otherwise.</p>
</blockquote>
<p>A simple implementation using <code>pdftools::pdf_data</code> with <code>font_info=TRUE</code> shows that:</p>
<pre><code>pdftools::pdf_data(pdf = &quot;https://arxiv.org/pdf/2012.10582.pdf&quot;, font_info = TRUE)
</code></pre>
<p><a href="https://i.stack.imgur.com/uz0YA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uz0YA.png" alt="enter image description here" /></a></p>
<p><strong>REMARKS:</strong></p>
<ol>
<li>Some <strong>bold</strong> fonts are indicated by suffixes of medium fonts (Medi) as in e.g., <code>KBJWLM+NimbusRomNo9L-Medi</code>.</li>
<li>The <em>italics</em> are indicated by suffixes like <code>ReguItal</code> which stands for 'Regular Italics'. For example, <code>ZBSJXS+NimbusRomNo9L-ReguItal</code>.</li>
<li>Regular fonts are obviously indicated by purely <code>Regu</code> suffixes as in <code>VDTZKA+NimbusRomNo9L-Regu</code>.</li>
</ol>
<p><strong>WARNING:</strong> This answer has never been tested for pdf images (scanned) with overlapped/overlayed text.</p>
how to extract bold text from a pdf using R
<p>I have searched through SO and the closest I got to the answer was <a href="https://stackoverflow.com/q/49536590/1972786">here</a>.
But my requirement is to get a simpler &amp; more elegant way to extract bold from a simple paragraph of text of pdf. The <code>pdftools</code> package only extracts the plain text component. Does anyone know if there is any other way to simply detect bold tokens (or words) from a chunk of text in pdf. I use R so kindly restrict to suggestions in R.</p>