I have a PDF template having two pages. In the template content is static except few fields are dynamic. I am reading the PDF template from a folder and replacing the AcroFields with some dynamic values.Which is working fine.
I Want to place a dynamic table in the second page of the PDF at a fixed position(in the middle of the 2nd page).
The table will have fixed columns and rows will be dynamic.
I go through link and link but it is placing the table at end of the document or stating of the document.
EDIT : Tried to place a AcroField on the place where I want to insert the table. But in the code behind I have generated the table but unable to replace the acrofield value with a table object.
Any help will be appreciated.
EDIT -2 : Now I am able insert the table in the second page using the below code. But another issue is if the table rows are increasing it overlapping the content which is exists below of the table. How can move the content to down if table height is increasing.
IList<AcroFields.FieldPosition> fieldPositions = fields.GetFieldPositions("Table");
AcroFields.FieldPosition fieldPosition = fieldPositions[0];
PdfPTable table = Table();
PdfContentByte cb = stamper.GetOverContent(2);
table.WriteSelectedRows(0, -1, fieldPosition.position.Left, fieldPosition.position.Top, cb);
stamper.FormFlattening = true;
stamper.Close();