Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Apr 26, 2022 2:21 pm

Hi,
I need to embed a PdfTextBoxField in a PdfGrid cell. I created the filed and set the cell value to it but it didn't show. I use intellij on Windows 10.

PdfTextBoxField txtbox1 = new PdfTextBoxField();
Dimension2D dimension2D = new Dimension();
dimension2D.setSize(30, 20);
txtbox1.setSize(dimension2D);
PdfFont font = new PdfFont(PdfFontFamily.Helvetica, 10f);
txtbox1.setText("test");
txtbox1.setFont(font);

TargetRow.getCells().get(2).setValue(txtbox1);

mgalal123
 
Posts: 29
Joined: Thu Apr 21, 2022 12:48 pm

Wed Apr 27, 2022 5:55 am

Hello,

Thank you for your inquiry.
Our Spire.PDF does not support adding the text boxe directly in the cell of the table, we add "PdfTextBoxField" according to the position. You can get the text position and text height by finding the text in the cell, and then add a "PdfTextBoxField" based on the text position and height. Please refer to the sample code in the attachment.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Wed Apr 27, 2022 11:36 am

thanks a lot

mgalal123
 
Posts: 29
Joined: Thu Apr 21, 2022 12:48 pm

Thu Apr 28, 2022 1:00 am

Hello,

You are welcome.

If you encounter other issues related to our products in the future, please feel free to contact us.

Have a nice day!

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF

cron