Free Support Forum - aspose.com

Footer only On first page

I have the code below which sets a footer to the pdf document.
But The problem is that the footer only apprears in the first page.
private static void AddTable3()
{
Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
Aspose.Pdf.Table table = GetTable();

for (int row_count = 1; row_count < 100; row_count++)
{
// add row to table
Aspose.Pdf.Row row = table.Rows.Add();

// add table cells
row.Cells.Add("Column (" + row_count + ", 1)");
row.Cells.Add("Column (" + row_count + ", 2)");
row.Cells.Add("Column (" + row_count + ", 3)");
}

Aspose.Pdf.Table table2 = GetTable();

for (int row_count = 1; row_count < 100; row_count++)
{
// add row to table
Aspose.Pdf.Row row = table.Rows.Add();

// add table cells
row.Cells.Add("Column NEW (" + row_count + ", 1)");
row.Cells.Add("Column NEW (" + row_count + ", 2)");
row.Cells.Add("Column (" + row_count + ", 3)");
}

doc.PageInfo.IsLandscape = true;
doc.Pages.Add();
doc.Pages[1].Paragraphs.Add(table);
doc.PageInfo.IsLandscape = true;
TextStamp textStamp = new TextStamp("Footer text");
// set properties of the stamp
textStamp.BottomMargin = 10;
textStamp.HorizontalAlignment = HorizontalAlignment.Center;
textStamp.VerticalAlignment = VerticalAlignment.Bottom;

// add footer on all pages
foreach (Page page in doc.Pages)
{
page.AddStamp(textStamp);
}
// Save updated document containing table object
doc.Save("C:\\temp\\A_FooterTest1.pdf");
}

Hi Helen,


Thanks for contacting support.

I have tested the scenario and I am able to
notice the same problem. For the sake of correction, I have logged this problem
as
PDFNEWNET-39396 in our issue tracking system. We will further
look into the details of this problem and will keep you updated on the status
of correction. Please be patient and spare us little time. We are sorry for
this inconvenience.

Is there a workaround that I can use for now.


Hi Helen,


As a workaround, you may consider first creating a PDF document, save the output in MemoryStream and then consider adding Footer Stamp over resultant file. In case you still face any issue, please share some further details.