title: extract pdf using pdfminer with whitespace
body: <p>I am trying to extract text from pdf, which is discussed in SO multiple times, but still I am unable to extract pdf, retaining the whitespaces between words.</p>
  
  <pre><code>$python3
  Python 3.5.2 (default, Sep 14 2016, 11:28:32) 
  [GCC 6.2.1 20160901 (Red Hat 6.2.1-1)] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import PyPDF2
  &gt;&gt;&gt; pdfFileObj = open('/var/tmp/acs%2Eaccounts%2E6b00452.pdf','rb')
  &gt;&gt;&gt; pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
  &gt;&gt;&gt; pageObj = pdfReader.getPage(0)
  &gt;&gt;&gt; pageObj.extractText()
  </code></pre>
  
  <p>Which is yeilding:</p>
  
  <blockquote>
    <p>'TowardtheRationalDesignofNovelNoncentrosymmetricMaterials:\nFactorsIn\nuencingtheFrameworkStructures\nKangMinOk\n*DepartmentofChemistry,Chung-AngUniversity,84Heukseok-ro,Dongjak-gu,Seoul06974,RepublicofKorea\nCONSPECTUS:Solid-statematerialswithextendedstructureshaverevealed\nmanyinterestingstructure-relatedch\naracteristics.Amongmany,materials\ncrystallizinginnoncentrosymmetric(NCS)spacegroupshaveattractedmassive\n\nattentionattributabletoavarietyofsuperbfunctionalpropertiessu</p>
  </blockquote>
  
  <p>but, if I use <code>pdf2txt.py</code> directly in terminal, I am getting:</p>
  
  <pre><code>$pdf2txt.py '/var/tmp/acs%2Eaccounts%2E6b00452.pdf'| more
  </code></pre>
  
  <p>I am getting the output:</p>
  
  <blockquote>
    <p>Article</p>
    
    <p>pubs.acs.org/accounts</p>
    
    <p>Toward the Rational Design of Novel Noncentrosymmetric Materials:
    Factors Inﬂuencing the Framework Structures</p>
    
    <p>Kang Min Ok*</p>
    
    <p>Department of Chemistry, Chung-Ang University, 84 Heukseok-ro,
    Dongjak-gu, Seoul 06974, Republic of Korea</p>
    
    <p>CONSPECTUS: Solid-state materials with extended structures have
    revealed many interesting structure-related characteristics. Among
    many, materials crystallizing in noncentrosymmetric (NCS) space groups
    have attracted massive attention attributable to a variety of superb
    functional properties su</p>
  </blockquote>
  
  <p>which is the desired output.</p>
  
  <p>I am not getting what I am doing wrong in my python script.
  Please help.</p>