We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Page contents extend to footer area

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;

now my pageContent bleaks to footer area.
Can anyone please tell me what is the issue.

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.

Hi Amit,


Thanks for using our products.

I have tested the scenario using Aspose.Pdf for .NET 7.4.0 and as per my observations, the contents are appearing in Footer area of PDF file. For your reference, I have attached the resultant PDF file which is generating over my end. Can you please share which version of Aspose.Pdf for .NET you are using ?

We are sorry for this inconvenience.

PS, All the three text objects are added to Footer area because you have added them to the paragraphs collection of Footer object.

Hi Nayyar,

As per the above post I think that you did not get my problem. My pdf page contains a aspose table as well as some footer. As per the normal functionality if i set

sec1.PageInfo.Margin.Bottom = 50;

sec1.PageInfo.PageHeight = 707.5F;

the aspose table should not extends to footer area and overlap it. It is actually overlapping to footer area, that is my problem. I have uploaded one pdf file generated at my end. please check

Hi Amit,


I have tested the complete code snippet (the one with table definition) and have observed that when table cell contains large contents, the rows are appearing in Footer area. For the sake of correction, I have logged this issue as PDFNEWNET-34477 in our issue tracking system. We
will investigate this issue in details and will keep you updated on the status
of a correction.

We
apologize for your inconvenience.

Hi Aspose Team,

Can you please tell me the timeframe by what time I can expect the bug to get resolved. I have suggested Aspose.PDF to our client for pdf generation. Now I am in trouble with these issues. My clients are asking to resolve this small formatting issue.

I found one more issue with Aspose.pdf. Can you look into that issue also.

http://www.aspose.com/community/forums/424394/regarding-extra-hyperlink-being-created-in-pdf/showthread.aspx#424394

Hi Amit,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

amit9899110286:

Can you please tell me the timeframe by what time I can expect the bug to get resolved. I have suggested Aspose.PDF to our client for pdf generation. Now I am in trouble with these issues. My clients are asking to resolve this small formatting issue.

Well, as we are just able to reproduce your issue, it will require some time for our development team to further analyze your issue and fix it (as per their schedule). However, as soon as we have any update, we will share with you via this forum thread. Please be patient and spare us some time to further look into your issue.

amit9899110286:

I found one more issue with Aspose.pdf. Can you look into that issue also.

http://www.aspose.com/community/forums/424394/regarding-extra-hyperlink-being-created-in-pdf/showthread.aspx#424394

Please see the reply here regarding your query.

Sorry for the inconvenience,

Hi,


I encounter similar issue, is there any fix/ update?

Cheers

Hi Melisa,


Thanks for your inquiry. Please use new DOM approach for creating tables, hopefully it will resolve the issue. If issue persist then please share your sample code so we will look into it and guide you accordingly.

We are sorry for the inconvenience caused.

Best Regards,

Have this issue been resolved? I have the same issues where the content is overflowing past the footer. I have no tables and i’m using version 10.08

Hi Chris,


Thanks for your interest in Aspose. Yes, page and footer contents overlapping issue has been fixed in new generator(Aspose.Pdf). Please use Aspose.Pdf for to create PDF document from scratch. Please check following documentation link for working with tables in new DOM, it will help you to accomplish the task.


Please feel free to contact us for any assistance.

Best Regards,