I have this page setting
Section sec1 = pdf1.Sections.Add();
sec1.PageInfo.Margin.Left = 50;
sec1.PageInfo.Margin.Right = 50;
sec1.PageInfo.Margin.Top = 50;
sec1.PageInfo.Margin.Bottom = 50;
sec1.PageInfo.PageHeight = 707.5F;
And footer setting is
Aspose.Pdf.Generator.HeaderFooter footer = new Aspose.Pdf.Generator.HeaderFooter(sec1);
// set the Odd footer of the PDF file
sec1.OddFooter = footer;
// set the Even footer of the PDF file
sec1.EvenFooter = footer;
Aspose.Pdf.Generator.Text txtfooter = new Aspose.Pdf.Generator.Text();
footer.Paragraphs.Add(txtfooter);
txtfooter.Segments.Add(" Bank of Baroda");
txtfooter.TextInfo.FontSize = 8;
txtfooter.TextInfo.Alignment = AlignmentType.Left;
txtfooter.TextInfo.FontName = "Calibri";
txtfooter.TextInfo.IsTrueTypeFontBold = true;
//Aspose.Pdf.Generator.Segment segfooter = txtfooter.Segments.Add();
Aspose.Pdf.Generator.Text txtPageNum = new Aspose.Pdf.Generator.Text(footer, "\t\t\tpage $p of $P");
txtPageNum.TextInfo = new TextInfo
{
Alignment = AlignmentType.Right,
FontSize = 8,
FontName = "Calibri",
IsTrueTypeFontBold = true
};
//segfooter.InlineParagraph = txtPageNum;
footer.Paragraphs.Add(txtPageNum);
Aspose.Pdf.Generator.Text txtfooterMiddle = new Text(sec1);
footer.Paragraphs.Add(txtfooterMiddle);
txtfooterMiddle.TextInfo.Alignment = AlignmentType.Center;
txtfooterMiddle.TextInfo.FontName = "Calibri";
txtfooterMiddle.TextInfo.FontSize = 8;
txtfooterMiddle.Segments.Add("Confidential");
footer.DistanceFromEdge = 5;
The aspose table creation code is
Aspose.Pdf.Generator.Table tab = new Aspose.Pdf.Generator.Table();
//Add the table in paragraphs collection of the desired section
sec1.Paragraphs.Add(tab);
//Set default cell border using BorderInfo object
tab.DefaultCellBorder = new Aspose.Pdf.Generator.BorderInfo((int)Aspose.Pdf.Generator.BorderSide.All, 0.1F);
tab.DefaultCellPadding = margin;
//tab.Margin.Left = 50;
tab.Margin.Right = 50;
//Set with column widths of the table
tab.ColumnWidths = "20 100 370";
Aspose.Pdf.Generator.Row row = tab.Rows.Add();
row.Cells.Add("Process, Application, Database, or System Reviewed");
row.Cells[0].ColumnsSpan = 2;
row.Cells[0].BackgroundColor = new Aspose.Pdf.Generator.Color("#A4A4A4");
row.Cells[0].DefaultCellTextInfo = new TextInfo
{
IsTrueTypeFontBold = true,
FontSize = 9
};
row.Cells.Add(dr["SystemType"].ToString(), new TextInfo { FontSize = 9, FontName = "Calibri" });
int i = 1;
int iHigh, iMedium, iLow, iTotal;
iHigh = iMedium = iLow = iTotal = 0;
foreach (DataRow drUpdate in getProjectUpdates(id).Tables[0].Rows)
{
if (!string.IsNullOrEmpty(drUpdate["FindingRating"].ToString()))
{
iTotal++;
//1st Row
row = tab.Rows.Add();
row.Cells.Add(i.ToString());
row.Cells[0].RowSpan = 5;
row.Cells[0].BackgroundColor = new Aspose.Pdf.Generator.Color("#A4A4A4");
row.Cells[0].DefaultCellTextInfo = new TextInfo
{
IsTrueTypeFontBold = true,
FontSize = 9,
Alignment = AlignmentType.Right
};
row.Cells.Add("Security Finding and Related Risk");
row.Cells[1].BackgroundColor = new Aspose.Pdf.Generator.Color("#D8D8D8");
row.Cells[1].DefaultCellTextInfo = new TextInfo
{
IsTrueTypeFontBold = true,
FontSize = 9
};
Text txtsecF = new Text();
txtsecF.IsHtmlTagSupported = true;
Segment segSecF = txtsecF.Segments.Add(drUpdate["secFinding"].ToString().Replace("times new roman", "Calibri"));
segSecF.TextInfo = new TextInfo
{
FontSize = 9
};
Aspose.Pdf.Generator.Cell cel = row.Cells.Add();
cel.Paragraphs.Add(txtsecF);
//row.Cells.Add(drUpdate["secFinding"].ToString(), new TextInfo { FontSize = 9 });
//2nd Row
Aspose.Pdf.Generator.Row row2 = tab.Rows.Add();
row2.Cells.Add("Finding Rating");
row2.Cells[0].BackgroundColor = new Aspose.Pdf.Generator.Color("#D8D8D8");
row2.Cells[0].DefaultCellTextInfo = new TextInfo
{
IsTrueTypeFontBold = true,
FontSize = 9
};
row2.Cells.Add(drUpdate["FindingRating"].ToString(), new TextInfo { FontSize = 9 });
if (string.Equals(drUpdate["FindingRating"].ToString(), "High", StringComparison.CurrentCultureIgnoreCase))
{
iHigh++;
}
else if (string.Equals(drUpdate["FindingRating"].ToString(), "Medium", StringComparison.CurrentCultureIgnoreCase))
{
iMedium++;
}
else if (string.Equals(drUpdate["FindingRating"].ToString(), "Low", StringComparison.CurrentCultureIgnoreCase))
{
iLow++;
}
//3rd Row
Aspose.Pdf.Generator.Row row3 = tab.Rows.Add();
row3.Cells.Add("Consulting Remarks");
row3.Cells[0].BackgroundColor = new Aspose.Pdf.Generator.Color("#D8D8D8");
row3.Cells[0].DefaultCellTextInfo = new TextInfo
{
IsTrueTypeFontBold = true,
FontSize = 9
};
Text txtConsRmrks = new Text();
txtConsRmrks.IsHtmlTagSupported = true;
Segment segConsRmrks = txtConsRmrks.Segments.Add(drUpdate["Remarks"].ToString().Replace("times new roman", "Calibri"));
segConsRmrks.TextInfo = new TextInfo
{
FontSize = 9
};
Aspose.Pdf.Generator.Cell celConsRmrks = row3.Cells.Add();
celConsRmrks.Paragraphs.Add(txtConsRmrks);
//row3.Cells.Add(drUpdate["Remarks"].ToString(), new TextInfo { FontSize = 9 });
//4th Row
Aspose.Pdf.Generator.Row row4 = tab.Rows.Add();
row4.Cells.Add("Controls and Remediation");
row4.Cells[0].BackgroundColor = new Aspose.Pdf.Generator.Color("#D8D8D8");
row4.Cells[0].DefaultCellTextInfo = new TextInfo
{
IsTrueTypeFontBold = true,
FontSize = 9
};
Text txtCntrlRemmed = new Text();
txtCntrlRemmed.IsHtmlTagSupported = true;
Segment segCntrlRemmed = txtCntrlRemmed.Segments.Add(drUpdate["ControlsAndRemediation"].ToString().Replace("times new roman", "Calibri"));
segCntrlRemmed.TextInfo = new TextInfo
{
FontSize = 9
};
Aspose.Pdf.Generator.Cell celCntrlRemmed = row4.Cells.Add();
celCntrlRemmed.Paragraphs.Add(txtCntrlRemmed);
//row4.Cells.Add(drUpdate["ControlsAndRemediation"].ToString(), new TextInfo { FontSize = 9 });
//5th Row
Aspose.Pdf.Generator.Row row5 = tab.Rows.Add();
row5.Cells.Add("Date");
row5.Cells[0].BackgroundColor = new Aspose.Pdf.Generator.Color("#D8D8D8");
row5.Cells[0].DefaultCellTextInfo = new TextInfo
{
IsTrueTypeFontBold = true,
FontSize = 9
};
row5.Cells.Add(((DateTime)drUpdate["updateDT"]).ToShortDateString(), new TextInfo { FontSize = 9 });
i++;
}
}
now my pageContent bleaks to footer area.
Can anyone please tell me what is the issue.