Change Layout::FormattedText nested in a table

I’m trying to use the LayOut Ruby API to change existing text objects within LayOut.

When I access a Layout::FormattedText object that’s just an entity on a Page, or is nested in a Group, using the #plain_text= method to assign a new string works fine.

However, when I access a FormattedText object in a Table (or in a Dimension), I’m unable to change the existing text using the #plain_text= method. I can understand this limitation for a Dimension, but any ideas why this won’t work for text in a TableCell?

Does anyone have ideas for how to change the text in a LayOut table programmatically?


After you’ve modified your FormattedText object, you will need to use TableCell#data=. The reason for this is that you got a copy of the TableCell’s text entity, not the original.

Hope this helps,

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.