QML formatting text in TextEdit - textfield

I'm new to QML, I'm trying to create text editor where you can format text to make it bold, italic, underlined, justification etc. basically I want this to act as general text editor ( LibreOffice Writer or other )
Next step is to convert formatted text in TextEdit field to HTML code, so if text in field is bold then <B>...</B> is added to text, etc.
I managed to create this kind of editor in GDK using text buffer and tags but I don't know where to start with QML.

You can still use tags for formatting text inside a TextEdit Element, as shown in the documentation.

Related

Adobe PDF Forms - Text Field displays value only when clicked on it

I have a PDF with forms defined in it.
One field in the form is a multi line text field.
The value in the text field is populated by a java program using Apache PDFBox.
The issue is when the value is of around 5 to 6 lines, the text box displays the text automatically. But if it is more than 6 lines, the text box does not display the value. I had to specifically click on the text field to display the text. If I click outside the text box again, the text disappears.
The text field is read only with Multi Line and Scrolling options enabled.
Any ideas what is causing this weird issue?
I have Adobe Acrobat Pro 11, Adobe Acrobat XI and Adobe Reader to view the files. All have the same issue.
It sounds like a typical "appearance" problem. There's no form field appearance in the field widget dictionary so when you click in the field, the raw string data is shown but when you click out there is no appearance to display so you get a blank. You can test this out by toggling the multi-line setting in the field properties in Acrobat so it generates an appearance. If that fixes it, then you the problem is the one I describe.
You can use PDFBox to set the "needs appearances" flag in the file that will tell Adobe viewers to regenerate field appearances when the file is opened but that doesn't work for all PDF viewers. To make the field value visible in all PDF viewers, it's best to generate appearances when you populate the field values.
The Datalogics PDF Java Toolkit can automatically generate appearances based on field values. Full disclosure, I represent Datalogics.

Can a PDF handle html codes?

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.

How to preserve text formatting in RichTextBox like Bold, Italics, font color, font size, etc?

I have created an application and for that application, I have designed a help file in Microsoft word. The help file is too long. So I decided to use the RichTextBox control in vb.net. I copied all the content from the word file. Now, I need to preserve the text formatting I have done in the actual file (like bold, italics, etc).
How can I preserve the text formatting?
Is there any other way I can display the help file in vb.net with properly formatted text?
RichTextBox supports rtf content, you can't directly paste the Word content in your RichTextBox .
You need to convert the word document into .rtf file. Best way is to
use the save As dialog in Microsoft Word.
Then you could deploy the document with your application and then load rtf content in your RichTextBox using LoadFile method.
RichTextBox1.LoadFile("Help-File.rtf")
Obviously, it supposes that basic formatting like mentioned in title (Bold, Italics, font color, font size, ...) are enough for this purpose, since the rft format does not support all MS Word features.
Otherwise you may have to implement your own parse/interpretation logic.
Here is how I did it:
I converted the word document int rtf format using the save as dialog box in microsoft word. Then copied the file named "help-file.rtf" into the executable folder (the executable is generally present within the debug or Release folder).
Copy the file in rtf format to the application executable folder and then use the following function:
RichTextBox1.LoadFile("Help-File.rtf")
Here, RichTextBox1 is the name of the RichTextBox control. Use the function above to load the file into the RichTextBox control.

Programmatically determine text visibility in PDF document

Using iTextSharp or some other library, is it possible to determine if a given part of the text is visible?
Using other word, is it possible to extract (to simple text) only the visible parts?
For example, if a given text segment has its font color white, then that text segment would be invisible when printing or displaying on screen.
My goal is to find a way to extract only the text that would be visible when printing that document!

Convert textbox's text (containing different characters of different font & color ) into image or picturebox

I am doing project in vb.net
I am using a Rich text box on which i can set different font (name,size,bold,italic,underline),color to different selected text.
I am able to do this in Rich textbox but i want to create bitmap (or assign to picturebox) of this of different text with different font style & color but i am getting not much font as like textbox in image..
Is there any method to convert Rich textbox text directly to image which contain different font style & color for different text.
output should like following image....
Kindly take a look at this article.
http://stpetrus27.wordpress.com/2011/08/24/c-rtf-to-image/
It should provide you with what you need.