Does the cell "Shrink" feature in Calc also exist in Writer?

In Calc the “Shrink to fit cell size” option found in the “Alignment” tab from the “Format” - “Cells” menu offers the possibility of automatically adapting (automatically reducing) the font size to ensure that it is everything in the cell is displayed.
Is there this feature in Writer?
Is it possible to then display it in a PDF form?

I assume your question is related to Writer tables.

The concept in Writer is different from Calc.

  • In Calc, the primary factor is the sheet where rows and columns impose cell size. Data will be clipped to this size unless you request otherwise.
  • In Writer, text is the primary factor. Cell size will adapt so that text is fully visible (and can even be split on next page(s)). Limiting cell size requires an explicit user action.

In Writer, formatting text is extremely important. User chooses some font size and Writer will honour this in all circumstances. Ticking Fit to size will adjust cell height to what is needed for text, i.e. will expand as necessary to display whole text. It will never shrink your row height is you defined it taller than the strict minimum to hold your text.

There is an imperfect workaround. You can apply a specific paragraph style (a custom style to create) to your critical cell text. Then modifying the style font size will affect all so styled paragraphs simultaneously. This supposes that all involved cells have roughly the same characteristics regarding contents size.

Since this operates at formatting level, it is forwarded to PDF.

However, you’re talking about forms. Form controls are somewhat outside the “traditional” formatting Writer directives, i.e. they aren’t controlled by styles. Therefore you must act manually on each individual control.

PS: when asking here, always mention OS name, LO version (done) and save format.

I apologize but I didn’t explain myself well.
Thank you for the very quick response to my question.
The OS is Windows 10 Pro; LibreOffice 7.5.9.2; save format “.odg”
The difference between the Calc and Writer tools is very clear to me.
My difficulty is on how to create “Text box” in a “Form” type document in Writer and then export it to “Fillable PDF”.
This field must be able to be filled in and therefore it must be able to contain a text that is normally less than 20 characters but could also be 50. I would therefore format this field to contain a 16pt character but, in case the text is too long to be contained within the limits of the field, the font size should automatically be reduced to a maximum of 9pt.
With Calc a similar effect is obtained by applying the “Shrink to fit cell size” feature to the cell. In this way the cell is not sized based on the content but exactly the opposite: by keeping the cell size fixed, the character size is automatically reduced based on the length of the text you are going to write in it.
But perhaps what I’m asking for isn’t achievable with Writer and maybe it isn’t even manageable from PDF…

It is achievable. But your thoughts are stuck on Calc functions that won’t get you anywhere. Clear your mind for new possibilities.

  • Set a font size that will last
  • Limit the number of characters for a field
  • Specify a field size for the visible area that remains unchanged
  • Assign a scroll option to a field so that you can have more text in the field than is currently visible
    Make clever use of these options, just as thousands of users have done before you.

See Writer Guide - Chapter 18 Forms

2 Likes

Then you are neither in Calc, nor in Writer. .odg is the save format for Draw.

In Draw, you design shapes (which can be labelled, thus every shape behaves like a “text box”) and there is no notion of text flow nor computation between cells. The graphical drawing you obtain in Draw is not meant to be “dynamic” nor to be filled unless you desing a form in Draw (which IMHO makes usually more sense than in Writer if your form is supposed to be stand-alone).

Shapes in Draw are more “static” than objects of the other components.

Test1.odt (11.5 KB)

I have verified that those “thousands of users” are most likely much more intelligent and knowledgeable than me.
I read the manual, I tried to follow your instructions and I tried the various options but I didn’t reach my goal!
Could you send me an example?
I forward the file where I did a few tests but without success.

103665 HB Test.odt (9,6 KB)

1 Like

You are right about “my thoughts are stuck on Calc functions”.
But there’s a reason. What Calc does is exactly what I need the Writer module to do.
I am ready to free my mind for new possibilities but certainly not to distort the goal I have set myself.
You told me “it’s achievable” but what? Something completely different from what I need.
Thank you very much for the example you sent me but it doesn’t even come close to what I would like to do. It’s something completely different!
Does anyone have any ideas or should I just give up because it can’t be done?

Maybe something could be done, inserting a spreadsheet as OLE embedded.
Untitled 2.odt (15.8 KB)

I don’t think it’s possible to export it to PDF format.
I tried with the example that mariosv sent but it doesn’t work…