how to set margins on NSAttributedText when converting from RTF
<p>I'm converting some RTF text into an NSAttributedString using this code (Xamarin C#, but the same logic applies to Swift/Obj-C)</p>

<pre><code>NSData data = NSData.FromString(RTFString);
NSDictionary opt = NSDictionary.FromObjectAndKey(NSObject.FromObject("NSDocumentTypeDocumentAttribute"), NSObject.FromObject(NSDocumentType.RTF));
NSDictionary docatt = null;
NSError error = null;
NSAttributedString sRTF = new NSAttributedString(data, opt, out docatt, ref error);
</code></pre>

<p>this works great, but when converting the RTF text it seems to set a default right margin value, so that the text is not flowing across the full width of the UILabel.  There is no margin value set in the original RTF text.</p>

<p>How can I change or set the right-margin value of the resulting attributed text so that it flows across the entire width of my label?</p>

<p>Sample RTF</p>

<p><a href="https://www.dropbox.com/s/7i4de1y9rwlfqev/sample.rtf?dl=0" rel="nofollow noreferrer">sample.rtf</a></p>

<pre><code>{\\rtf1\\ansi\\ansicpg1252\\uc1\\htmautsp\\deff2{\\fonttbl{\\f0\\fcharset0 Times New Roman;}{\\f2\\fcharset0 Segoe UI;}}{\\colortbl\\red0\\green0\\blue0;\\red255\\green255\\blue255;\\red255\\green165\\blue0;}\\loch\\hich\\dbch\\pard\\plain\\ltrpar\\itap0{\\lang1033\\fs26\\f2\\cf0 \\cf0\\ql{\\f2 {\\b\\fs30\\cf2\\ltrch 1.  Gum/Lip Irritation:  }{\\fs24\\ltrch Whitening gel that comes into contact with gum tissue or the lips can become inflammed or bleached.  The inflammation or whitening effect is temporary.  You may feel a stinging and/or tingling sensation on these soft tissues during the treatment.2.  Tooth Sensitivity: You may experience some tooth sensitivity during the first 24 hours after your treatment.  Underlying tooth/gum disease such as existing sensitivity, cracked teeth, open cavities, leaking fillings, exposed roots or other dental conditions may worsen or prolong tooth sensitivity after treatment.3.  Spots or Streaks:  There is a potential to develop white spots or streaks on your teeth due to calcium deposits that naturally occur in teeth.  These spots are not caused by Beaming White gel.  The gel just brings these calcium deposits out and makes them more visible.  This effect will fade over time.4.  Relapse:  After your treatment, it is natural for teeth color to regress over time.  This relapse can be slowed down by avoiding staining agents such as coffee, tea, tobacco, red wine, colas etc.  It is very important to avoid these staining agents, especially during the first 24 hours after treatment.  I understand that the results of my treatment are not permanent, that up to 3 applications may be needed for desired effect and maintanence treatment every recommended very 4-6 months.}\\li0\\ri0\\sa0\\sb0\\fi0\\ql\\par}\r\n}\r\n}
</code></pre>

<p><a href="https://i.stack.imgur.com/xTHRT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xTHRT.png" alt="Yellow shows extent of UITextView, with right margin"></a></p>