iText7 : truncate contents only if multiple line text - itext

I am developing iText7 application and I am trying to add a text in a rectangle.
I am reading this article, I would like to add a text in the condition below.
If the content is a multiple line text as Text Text Text Text Text Text Text Text \n Multiple Line Text (has new line in the text), the content longer than rectangle width should be truncated width dot-dot-dot as Fig.1.
If the content is a single line text as Single Line Text Single Line Text Single Line Text (no new line in the text), the content longer than rectangle width should not be truncated and should be wrapped to the next line as Fig.2.
Can I do this with iText7?

Related

Flutter, TextField direction line by line

how i can build a textField to change text direction line by line ( based on the first character )
For example, I want it to be displayed as below when typing 2 letters in different languages in the text field
// this line started with LTR characters, start at left
Hi Good morning
// this line started with RTL characters, start at right
سلام، صبح بخیر
Are you ok?
حالت خوبه؟
I looked at Flutter's code and noticed that Flutter uses text span to create text in the text field (that is, all the text can only be changed), is this possible with Flutter's own text field widget?

How to set width of text marks in vega-lite / altair (text wrapping and line break) for long text

I am trying to display text over time using altair (vega-lite), which works fine using a layered chart, where one is created using the alt.Chart().mark_text() function to display the text.
The text though is multiple phrases and should be wrapped (with line breaks). How can this be done?
(I do not want to use fixed line breaks, e.g. \n, at distinct positions since the text wrapping should work with zooming too)
Not exactly what you want, but you can specify a character on which to break to a new line. When zooming, the text stays the same size, so it should always fit the view.
For example making a new line for every word:
.mark_text(lineBreak=' ')

Copy text in flutter along with text styling

The textview in flutter has some styling(Font family,color,style etc) and when I try to copy the text, only the text value gets copied but I need styling also.
styling properties are given to display text in given Style it is not the property of text.
Text is copied in UTF byte Format
so, When you copy text Only text gets copied the style and Other property does not get copied.

How to make an image co-exist on same line as text in RTF

I am using Perl RTF::Writer to insert an image at the center of a page with descriptive text at the left side. Like this dummy image:
I'm able to format the text perfectly, but I so far cannot get the image to co-exist on the same line with text. The image wants to be the only object on that line and bumps any text on its line down to the bottom of the image.
Here's the code I'm trying so far:
$rtf->paragraph(
\'\qc\ul\f0\fs28\b',
"Sugar Maple\n");
$rtf->paragraph(
\'\lc\f0\fs24\plain',
"Common name: $ID\nScientific Name: $sciname",
$rtf->image('filename' => "$pngName"),"\nDistribution: Eastern US");
$rtf->close;
But this results in "Distribution" being located at the bottom of the image. How can I adjust this code to make the left-aligned text in line with the center-aligned image?

Merge lines in auto-fill-mode with GNU Emacs 24.1

How do I merge lines when I insert new text between paragraphs in auto-fill-mode?
For example suppose I have the following text:
text textᙂtext text text text |
text text text text text text |
text text text text text text |
where the |'s indicate the maximum line width and ᙂ is the cursor. So if I add more text:
text text more more more moreᙂtext text text text
text text text text text text |
text text text text text text |
then maximum line width is not respected. I would like something like
text text more more more moreᙂ|
text text text text text text |
text text text text text text |
text text text text |
I've tried refill-mode but I don't like how it works, it is too intrusive and doesn't let me add text at the end of a paragraph.
If refill-mode doesn't let you add text at the end of a paragraph, then please report this via M-x report-emacs-bug.