<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Pdf on Shafiq Alibhai</title>
    <link>https://www.shafiq.in/zh/tags/pdf/</link>
    <description>Recent content in Pdf on Shafiq Alibhai</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <copyright>© 2009-2026 All rights reserved.</copyright>
    <lastBuildDate>Tue, 05 Sep 2023 04:30:03 +0000</lastBuildDate>
    <atom:link href="https://www.shafiq.in/zh/tags/pdf/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>How to count number of words in a pdf file from Linux cli</title>
      <link>https://www.shafiq.in/zh/blog/how-to-count-number-of-words-in-a-pdf-file-from-linux-cli/</link>
      <pubDate>Tue, 05 Sep 2023 04:30:03 +0000</pubDate>
      <guid>https://www.shafiq.in/zh/blog/how-to-count-number-of-words-in-a-pdf-file-from-linux-cli/</guid>
      <description>&lt;h3 id=&#34;using-pdftotext&#34;&gt;Using &lt;code&gt;pdftotext&lt;/code&gt;:&lt;a class=&#34;anchor&#34; href=&#34;#using-pdftotext&#34;&gt;#&lt;/a&gt;&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Installation&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If it&amp;rsquo;s not installed, you&amp;rsquo;ll need to install the &lt;code&gt;poppler-utils&lt;/code&gt; package which includes &lt;code&gt;pdftotext&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;sudo apt install poppler-utils&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;yum install poppler-utils&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;depending on your distribution.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Once installed, you can convert a PDF to text and then count the words as follows:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;pdftotext input.pdf - | wc -w&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here, &lt;code&gt;input.pdf&lt;/code&gt; is your source PDF file, and &lt;code&gt;wc -w&lt;/code&gt; counts the number of words. The &lt;code&gt;-&lt;/code&gt; in &lt;code&gt;pdftotext&lt;/code&gt; specifies that the output should be sent to stdout, which is then piped into &lt;code&gt;wc&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
