I'm am under the assumption that if I do the following:
Code:
SetStyles(doc, MigraDoc.DocumentObjectModel.Unit.FromCentimeter("21"))
Dim docRenderer As MigraDoc.Rendering.DocumentRenderer = New MigraDoc.Rendering.DocumentRenderer(doc)
docRenderer.PrepareDocument()
and SetStyle contains the initialization of style as found elsewhere in this forum, that a new paragraph created with .AddParagraph is of the style StyleNames.Normal.
However, when I do a .renderobject with this paragraph I get the error:
Value of '0' is not valid for 'emSize'. 'emSize' should be greater than 0 and less than or equal to System.Single.MaxValueEven when I set style active for the paragraph with
para.Style = StyleNames.Normal it doesn´t work.
However when I do:
para.Format.Font.Size = MigraDoc.DocumentObjectModel.Unit.FromPoint(iFontSize) the .renderobject succeeds.
How come the style is not being applied?