Steps to reproduce a infinite Loop in Migradoc TopDownFormatter.cs,
Function: FormatOnAreas(...),
Code Block:
Code:
while (!ready && area != null)
{
...
}
- Add a Image with width 150mm
- Add some (8) Text Items with one character
Code to reproduce the behaviour:
Code:
Document document = new Document();
var p = document.AddSection().AddParagraph();
var i = p.AddImage("C:\\Temp\\150.png");
double width;
width = 140; // Works
width = 150; // ***** LOOP ****
//width = 170; // Works
i.Width = Unit.FromMillimeter(width);
p.AddText("a");
p.AddText("a");
p.AddText("a");
p.AddText("a");
p.AddText("a");
p.AddText("a");
p.AddText("a");
p.AddText("a");
PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer(false, PdfFontEmbedding.Always);
pdfRenderer.Document = document;
pdfRenderer.RenderDocument();
MemoryStream stream = new MemoryStream();
pdfRenderer.PdfDocument.Save(stream, false);
pdfcontent.Content = stream.ToArray();
stream.Close();
Best regards
Peter