I have a simple example that shows the problem. It creates a Shape.TextBox on each of three pages. It uses the DocumentBuilder to add a PageBreak between the definition of the three Shape.TextBox instances. The output HTML shows all three TextBox instances overlapping each other with only a small separation. Here is the entire console application to show the issue…
class Program
{
static Document doc = new Document();
static DocumentBuilder builder = new DocumentBuilder(doc);
[STAThreadAttribute()]
static void Main(string[] args)
{
AddTextBox("First Page");
builder.InsertBreak(BreakType.PageBreak);
AddTextBox("Second Page");
builder.InsertBreak(BreakType.PageBreak);
AddTextBox("Third Page");
doc.Save("C:\\out.html");
}
static void AddTextBox(string str)
{
Shape shape = new Shape(doc, ShapeType.TextBox);
shape.Top = 10;
shape.Left = 10;
shape.Width = 200;
shape.Height = 200;
Paragraph paragraph = new Paragraph(doc);
Run run = new Run(doc, str);
run.Font.Underline = Underline.Single;
paragraph.AppendChild(run);
shape.AppendChild(paragraph);
builder.InsertNode(shape);
}
}