Can a PDF handle html codes? - pdf

I have a PDF and the textbox fields are being filled automatically, unfortunately what's supposed to be a multiline textbox FULLADDRESS has turned into a single line of text with <br> codes embedded in it.
Is there any way I can have the PDF handle the <br> codes by using any settings on the text box fields? Or am I stuck with <br> codes?
Thanks.
Edit: Can this be done with formatting javascript editor? Thanks.

The code for new lines in PDF multiline fields is \r (or \n).
You'd have to convert your HTML tags to these codes.
OR, if you activate the richText property of the field, you'd have to create an array of span Objects wich will then become the richValue property. But even there, you will have to use correct new line codes.

Related

Extract text using iTextSharp with different PDF page labels

I am trying to extract text from PDF using iTextSharp but I get null reference error while trying to call GetTextFromPage:
My guess would be that iTextSharp somehow interprets page label incorrectly as it is indeed strange:
Or is it due danish letters in the text?
However, I am able to extract text from different languages.
Thank you in advance.
EDIT: The problem could also be used fonts and their custom encoding:

iText - How to replace a character with a dynamic checkbox in a pdf

I'm using iText to working on pdf documents.
I have a pdf document with non-dynamic checkboxes (they are made with the character "□", unicode \u25A1); I need to replace that checkboxes with the dynamic checkboxes of iText.
It's possible?
I need it because the pdf document that I receive is not made by me and it contains that character.
Thanks for the help, and sorry for my not-perfect english

Check if RichTextBox has formatting (vb.net)

Is there a way to detect if there is formatting or not (i.e. Rich) anywhere in a RichTextBox?
I'd like to write RichTextBox.Rtf is there is, and RichTextBox.Text if there isn't.
I came across a post that suggested checking the SelectionFont after selecting all text, but I have no idea how to accomplish that, or if it would work.
Thanks!
You can check the rtf property of the richtextbox: richtextbox1.rtfto see the rich text code. Even with no additional formatting, there will be some rich text formatting. For example, here's what you get with a richtextbox containing only "text":
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\f0\fs16 test\par
}
You can check to see if there are any additional formatting tags, and if not, it should be plain text. You can also access the plain text (without formatting) with richtextbox1.text.

Force CK editor to save everything as it is

I am using CK editor on a text area. It is working fine but there is one problem and it is when I save content it removes some attributes and doesn't recognize all HTML tags. For example it is removing class attribute from ul li and also doesn't recognize many of HTML tags. Is there any way to modify CK editor so as to make to save everything. Removing it is not an option because CK editor is needed to make some customizations if a user is saving text. Thanks.
This should be the option you are searching for: http://docs.ckeditor.com/#%21/api/CKEDITOR.config-cfg-allowedContent
I couldn't get around this so I found another solution for this which I think might help others in similar situations. I now provide two options (using radio buttons) to users to save their data, through simple text box or through a fully CK editor loaded text box. If a user has already formatted text like containing lots of HTML tags, CSS classes, scripting etc they can simply select simple text box and it will save everything as it is without applying or removing anything. If they need to apply some formatting to simple text they can select loaded text box and format their text.

how to show rich formatted text in textarea

I have a form that uses Richtexteditor of Flex3 to write in their reply. The reply is then posted to a textarea, where all of the formatting is lost! I have embedded the font since I was doing some tweeening on the text boxes.
I need to find out how keep the formatting intact in the textarea from richtexteditor!
has anybody an idea?
Make sure that you set the htmlText property on the TextArea, not just text.