title: C# : Replacing word in PDF with retaining space between replaced and its neighboring word
body: <p><strong>This is what we want:</strong>
  We want to hide some specific words from PDF. This we are trying through searching and replacing word from PDF file. 
  Also replaced occurrences need to be highlighted with black fore-colour. Both these replace and highlighting actions are for hiding/masking some information in PDF. Replace action will not let future users of PDF to guess about the original identity of masked words; and highlighting is used to give indication about masking.
  If any such masked word is serving as link in PDF, it is expected to work as before.</p>
  
  <p><strong>This is what we tried and the problem:</strong> We tried this using Aspose.pdf for .net, and found that the single character used to replace all characters in searched word disturbs the formatting i.e original spacing between current and next word. 
  <strong>e.g.</strong> if 'stackoverflow' is searched and replaced with 'x' for every character in searched word, it may overlap with next word in line if the character width is more after replacement; OR the spacing between searched word and next word appears to be widened if character spacing is lesser for replaced word.</p>
  
  <p>Following situations could be expected:</p>
  
  <p>If replaced word pushes next word in line to next line, all remaining contents in PDF should be moved according. This may result in addition of a new line in PDF and related impact on rest of PDF contents.</p>
  
  <p>If replaced word frees up some pixel due to lesser character width, and allows next word to move towards left; it may result in words moving </p>
  
  <p><strong>Please assist if there exists any way to adjust (auto adjust) this spacing between words after replacements using Aspose.pdf.</strong></p>
  
  <p><strong>If this is not possible using Aspose, do you know any third party component which addresses this problem?</strong> </p>
  
  <p><strong>Or can this be achieved by creating a new pdf document from scratch using existing document with required replacements at runtime? And if this way is feasible, how to carry formatting in new pdf?</strong></p>
  
  <p>Thanks in advance.</p>