title: Removing text from PDF
body: <p>I'm looking for a solution to remove/delete ALL text from a pdf. I've been using iTextSharp for a while now, and extracting text from a pdf with it is easy (wihouth the use of OCR). However I can't find an option to delete the text.</p>
  
  <p><a href="https://stackoverflow.com/a/8779464/1711839">This solution</a> frankly doesn't work for me. </p>
  
  <pre><code>    page.GetAsArray(PdfName.CONTENTS);
  </code></pre>
  
  <p>returns null for me, also when using <code>PdfName.Text</code> and some others I've tried.</p>
  
  <p>The library to use doesn't really matter, I just think iTextsharp should be able to do this. However if there is another (free) solution, bring it</p>
  
  <p>EDIT: <strong>Just to make clear why I want to remove all text from the pdfs</strong></p>
  
  <p>I want to reduce the size of the pdf's. I do this by reducing the resolution of the images in the pdf. However, in alot of cases the vector images take up most of the space. So I thought of the following:
  Remove all text, than convert the remaining pdf (with only the images and vectors) to a bitmap (jpeg). After that I paste the text over it again.
  Another option would be to make the text invisible, but I don't think this is any easier.</p>