Hi, I am creating a section that is a header (using Aspose.Pdf.Generator), and then I am creating a body and then I need a footer. However in my code below, the Section secBody = pdf.Sections.Add() does a page break and puts the header on a seperate page. How can I make the body section be just below the header section? Thanks!
Code:
Pdf pdf = new Pdf();
pdf.IsTruetypeFontMapCached = false;
pdf.PageSetup.PageHeight = PageSize.A2Height;
pdf.PageSetup.PageWidth = PageSize.A2Width;
Section secHeader = pdf.Sections.Add();
HeaderFooter header = new HeaderFooter(secHeader);
secHeader.OddHeader = header;
Table tableLogo = new Table();
tableLogo.PositioningType = PositioningType.ColumnRelative;
header.Paragraphs.Add(tableLogo);
tableLogo.DefaultCellBorder = new BorderInfo((int)BorderSide.None, 0.1F);
tableLogo.ColumnWidths = "500 500";
Image img = new Image();
img.ImageInfo.File = @"F:\Fetch\logo999_110.bmp";
img.ImageInfo.ImageFileType = ImageFileType.Bmp;
img.ImageInfo.FixWidth = 1000;
Row row1 = tableLogo.Rows.Add();
Cell cellImage = row1.Cells.Add();
cellImage.Paragraphs.Add(img);
tableLogo.Rows[0].Cells[0].ColumnsSpan = 2;
Row row2 = tableLogo.Rows.Add();
row2.BackgroundColor = new Aspose.Pdf.Generator.Color("#0000A0");
row2.DefaultCellTextInfo.Color = new Aspose.Pdf.Generator.Color("#FFFFFF");
row2.DefaultCellTextInfo.FontName = "Verdana";
row2.DefaultCellTextInfo.FontSize = 12;
Cell cellTitle = row2.Cells.Add("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
cellTitle.Alignment = AlignmentType.Left;
Cell cellDate = row2.Cells.Add("20 November 2011");
cellDate.Alignment = AlignmentType.Right;
Row row3 = tableLogo.Rows.Add();
row3.DefaultCellTextInfo.FontSize = 12;
row3.DefaultCellTextInfo.FontName = "Arial";
Cell cellName = row3.Cells.Add("Firstname Lastname");
cellName.Alignment = AlignmentType.Left;
Cell cellEmail = row3.Cells.Add("email@companyname.com");
cellEmail.DefaultCellTextInfo.Color = new Aspose.Pdf.Generator.Color("#00FFFF");
cellEmail.Alignment = AlignmentType.Right;
Section secBody = pdf.Sections.Add();
Text txt = new Text("Test Body");
secBody.Paragraphs.Add(txt);