title: Unicode and PDF tooltips / messageboxes with iTextSharp
body: <p>I need to find a way to add a quite long string in a quite small space in a PDF document.</p>
  
  <p>I am using <em>iTextSharp</em>. I have already tried adding comment annotations (balloons) with <code>PdfAnnotation.CreateText()</code> and I didn't like the way they looked/worked. It made the page too heavy (I had many comments per page) and their behavior was odd in many ways (thank Adobe for that).</p>
  
  <p>Now I was thinking of adding some simple tooltips on 'chunks' in the page or popping-up messageboxes with javascript (like illustrated here : <a href="http://www.codehacker.com/ITEXTSHARP/chap15.aspx#" rel="nofollow noreferrer">http://www.codehacker.com/ITEXTSHARP/chap15.aspx#</a>). To my great disappointment however, it seems that Acrobat (?) doesn't support Unicode characters in those situations. E.g. I do this:</p>
  
  <pre><code>var javascript = new PdfAnnotation(
      w, 200f, 550f, 300f, 650f,
      PdfAction.JavaScript("app.alert('" + "Αρνάκι άσπρο και παχύ!" + "');\r", w));
  chunk.SetAnnotation(javascript);
  </code></pre>
  
  <p>...and, in the best case, a messagebox with gibberish pops up when the user clicks on the chunk.</p>
  
  <p>Is there any setting for making Unicode acceptable for the code above or another way to do what I want?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I have now seen this: <a href="https://stackoverflow.com/a/163065/964053">https://stackoverflow.com/a/163065/964053</a>
  and I've tried modifying my code like that:</p>
  
  <pre><code>var javascript = new PdfAnnotation(
      w, 200f, 550f, 300f, 650f,
      PdfAction.JavaScript((char)0xFEFF + "app.alert('" + "Αρνάκι άσπρο και παχύ!" + "');\r", w));
  chunk.SetAnnotation(javascript);
  </code></pre>
  
  <p>But nothing seems to change...</p>
  
  <hr>
  
  <p><strong>EDIT2 :</strong>
  Using octal representation e.g. <code>(\141)</code> doesn't seem to help either...</p>
  
  <hr>
  
  <p><strong>EDIT3 :</strong>
  This seems to work nice until you double clink on it, but I need to make the tooltip size itself based on the contents size:</p>
  
  <pre><code>var lToolTip = PdfFormField.CreatePopup(
      w, new Rectangle(tc.Left, tc.Bottom, tc.Right, tc.Top), val, true);
  chunk.SetAnnotation(lToolTip);
  </code></pre>
  
  <p>The rectangle provided doesn't seem to be used in any way...
  Any ideas?
  I don't know what PdfFormField.CreatePopup() is supposed to create, but I see a small mark on my page that displays a popup when you hover the mouse over it.</p>