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

Free Support Forum - aspose.com

Adding editable columns at the end of table

Hi team,

I’m trying to convert an excel to pdf using the latest version.

When I am converting a table (let’s say, m rows*n cols) I want to add 2 columns at the end of the table which will have editable fields (TextBoxField) as the cell content in the final converted pdf.
What is the best way to accomplish this?

Please note - I cannot manually edit the excel.
I will have to accomplish all this through code.

Please help.

Thanks,
Shaurya

@shaurya.chawla

We are moving your inquiry to Aspose.Cells forum category where you will be assisted accordingly.

I was asked by in the cells forum to raise my query here…

Converted PDF tables to have editable input fields - Free Support Forum - aspose.com

@asad.ali,

The user needs to read the PDF file (generated by Aspose.Cells) and add 2 columns at the end of the table which will have editable fields (TextBoxField) as the cell content in the final converted PDF via Aspose.PDF. Please assist him accordingly.

PS. I have also moved the thread back to Aspose.PDF forum.

@shaurya.chawla

We need your sample input document along with the sample code snippet that you have used and an expected output document for our reference. We will investigate the feasibility at our end and share our feedback with you accordingly.

Thanks for your reply @asad.ali

arena.zip (182.9 KB)
is the files.
excel input is what the code gets.
pdf input is the intermediate file we are generating using aspose.
expected output is the final product we want.

In my experience so far -
Excel to PDF conversion can’t add fillable text boxes.(ref - Converted PDF tables to have editable input fields )

Please review and let me know how we can achieve the expected output using either the excel input or the pdf input.

Regards,
Shaurya

@shaurya.chawla

We tried below code snippet in our environment to add form fields inside table cell but in the output PDF, no text box was present.

Document pdfDocument = new Document(dataDir + "pdf input.pdf");
foreach (var page in pdfDocument.Pages)
{
 Aspose.Pdf.Text.TableAbsorber absorber = new Aspose.Pdf.Text.TableAbsorber();
 absorber.Visit(page);
 foreach (AbsorbedTable table in absorber.TableList)
 {
  foreach (AbsorbedRow row in table.RowList)
  {
   var cello = row.CellList[5];
   Aspose.Pdf.Forms.TextBoxField txtBox = new TextBoxField(page, cello.Rectangle);
   txtBox.Characteristics.Background = System.Drawing.Color.Red;
   page.Paragraphs.Add(txtBox);
  }
 } 
}
pdfDocument.Save(dataDir + "output.pdf");

Therefore, an issue as PDFNET-53344 has been logged in our issue tracking system. We will further look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.