How do I set line spacing for FormFields in iText? - pdf-generation

It seems like the default line spacing in iText 7 form fields is 2 or 1.5, but I'd really like to remove the line spacing. Normally, I set line spacing by calling setMultipliedLeading(..) on a Paragraph object, but neither PdfAcroForm nor it's subclass, PdfTextFormField has this method, and only Strings can be set as the form field value. How do I set the value for line spacing? Thanks in advance.

As per ISO-32000-1 12.7.4.3, you are not able to set leading in an AcroForm.

Related

Xamarin.UWP RichTextBlock Hanging Indentation

I used custom renderer to display a Label as RichTextBlock. Using Paragraph, there is a TextIndentProperty to indent first line. However, I also need "Hanging Indentation" found in RichEditBox or SetIndent found in ITextParagraphFormat.
Is there a way to implemnent "Hanging Indentation" in RichTextBlock?
I have found the solution to this question.
Use left-padding to shift the entire paragraph in (say 10px)
Then, use text-indent with negative value to shift the first line of the paragraph out again (say -10px).
With this method, a hanging indentation can be achieved.

Adding a new line to a wrapping text field in swift

I am working on an OS X application in Xcode and I need to add a new line to a wrapping text field with code, but I've looked everywhere and even experimented some myself but I haven't been able to figure it out. I know when adding text to a wrapping text field that the text field will automatically add a new line when you've run out of space on the first line, but I want to create a new line in my text field with code. Any help would be appreciated.
A newline character can be written \n in a string, e.g. "\n".

Grouped TableView separator line

I have a grouped tableView with 3 sections. On the last section I have a single cell with a label. I need it to be completely transparent. I've done that but I still have the separator lines around and it's not very UI-pretty.
Is there any way to remove the separator lines for just one cell (or section for that matter)
Thanks in advance!

NSTextView with custom space width

I need to implement custom space separator with custom width between two part of paragraph in text view:
AAAA AA A -------- BBB BBBBB B
This is separator must be included as non-editable character. So user can't delete it or modify.
I understand, that i must overload standard behavior of textview in some points (for example, when user press "delete" right after separator nothing will be deleted)
I have several ideas how accomplish this task:
Use elastic glyph attribute (there are mentions in documentation about it). But I can't find any documentation about how to use it.
Use tab symbol and NSTextTab for each paragraph, and in any modification to the paragraph recalculate position of tab.
I will be very grateful for any right direction.
I had a similar problem and wound up inserting blank images of the desired width into the textview. The code for implementing this is here:
Changing the width of the space character in NSTextView

NSTextView paragraph style of newline

I've been playing around with NSTextView and have applied some paragraph styles to certain lines. However, when I type enter and get a new line, the attributes that I applied to one line are bleeding into the next.
I want to be able to apply a paragraph style to one line and have the next line be formatted in the default way. You can see what I mean from the screenshots.
When I add some spacing between paragraphs via NSParagraphStyle, the same spacing applies to the newline, which makes the whole thing look pretty shotty. Basically, I am looking for a way to reset the paragraph style for an empty line.
I have tried [MyTextView resetTypingAttributes:theAttributes] to no avail, since you first have to start typing for the new attributes to apply. Just to be clear, the line below the text in the screenshot is the cursor, which is really far down there as a result of the paragraph spacing.
Screenshot:
It seems that you have to use setTypingAttributes on the textview.

Resources