1

I'm creating a table with abcpdf. It should begin in the middle of the first page and break before the footer. Then it should restart at the beginning of the new page (it depends on the number of the rows).

Here is the code:

string theText = System.IO.File.ReadAllText(@"C:\Users\..file.txt")
Doc theDoc = new Doc();
theDoc.AddGrid();
theDoc.Rect.String = "10 200 600 780";
theDoc.FrameRect();
PDFTable theBigTable = new PDFTable(theDoc, 1);
theBigTable.NextRow();
theBigTable.SetRowHeight(200);
theBigTable.NextRow();
theBigTable.SetRowHeight(300);

PDFTable theTable = new PDFTable(theDoc, 5);
theTable.CellPadding = 5;
theTable.HorizontalAlignment = 1;

theText = theText.Trim();
theText = theText.Replace("\r\n", "\r");
string[] theRows = theText.Split(new char[] { '\r' });

for (int i = 0; i < theRows.Length; i++)
{
theTable.NextRow();
string[] theCols = theRows[i].Split(new char[] { '\t' });
theTable.AddHtml(theCols);
theTable.FrameColumns();
}
theTable.Frame();

theDoc.Flatten();

//footer
theDoc.Rect.String = "10 10 600 60";
theDoc.FrameRect();

theDoc.Save("output.pdf");
theDoc.Clear();

The issue is that the table re-starts in the new page in the same position (and not from the beginning) and it overrides the footer that appears only in the last page.

Any suggestions?

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
emploja
  • 11
  • 2
  • Have you check the official documentation about this problem on https://www.websupergoo.com/helppdfnet/default.htm? Have you tried their solution? What is the problem you have, when you use their solution? – Progman Feb 10 '19 at 11:26

0 Answers0