Content from word to Richtexbox - c#

I'm trying to copy an equation from word into a richtextbox control in winform.
The copy and the paste are done normally.But the paste of the equation is done as an image not as an equation file.(I cannot decode the pasted element in order to get the unicode text from it).
Is there a way to conserve the original component type after the paste is done ?
Or convert the image file to equation and get the unicode text from it ?
Any help would be appreciated

Related

Read word file content (image and text) with formatting information

I want to convert the complex word document (which includes both text and images) into RTF text preserving formatting information. Sample image of document content is as shown below
How I can read this information as RTF text so that I can perfectly preserve the formatting and image location information. I tried to read word file using RichTextbox's LoadFile function but it doesn't preserve the formatting & image location information.
Looking forward to receive some suggestions to maintain the formatting and image location information.
Thanks
You could simply save the document in the RTF format...

How to get caret position in RichTextBox which contains rtf

I am making a "reading speed tester" application using RichTextBox.
I need to colorize text fragments by moving caret in next position. So, when I load plain text file in RichTextBox - I can get proper caret position using rtb.CaretPosition.
But when i load rtf, CaretPosition property returns me '60' for first character. So it's correct, but I want to get caret position in text without any formatting (special symbols).
Can i do that without parsing rtf and converting one caret position to another manually ?

How to convert Text containing Images into pdf using iText#

I have a richtextbox and by far, i have been successful in converting plain text into pdf using iTextsharp. Now, the situation is, when i copy some text from any source let's say a website and along text, it contains images. Now when i try to convert the content (text + images) into pdf, resulting pdf doesn't show images. I know that there would be some property to be set for the richtextbox or using itextsharp so to have images as well. I also know that we can insert images by giving path to that image but this is not what i want. I want to have plain text along with images while direct conversion from richtextbox to pdf. Forexample i have,![Im resulting pdf i want the same as in richtextbox][1]: http://i.stack.imgur.com/ts0ec.jpg
How can i have the same as in richtextbox? How can i specify orientation for text and image to be justified?

Get Images count and positions from Rtf using C#

I have some RTF text. Sometimes text contain some images. Images is displayed inside any rtf editor, but i cannot get images positions programmatically.
I have used RichTextBox control for RTF parsing, but is unable to detect image positions inside text in RichTextBox control
So, does anybody know how to parse RTF and get images positions inside text programmatically using C#?
You might take a look at http://www.codeproject.com/KB/string/nrtftree.aspx it is open source and able to extract images, so I hope this helps.

Replace text in PDF

I'm trying to replace a section of a PDF with different text. From research on all major PDF libraries for .NET, it seems this is complicated and not a trivial task. I think it may be easier to convert the PDF to an image, replace the text (always in the same place), then convert it back to a PDF (or leave it as an image if converting back isn't possible). Is it possible to extract an image from a PDF page with .NET?
If your text is in a known location, you can simply cover it with a rectangle filled with the background color, and then draw your text over top.
Note that the text will still be there, it simply won't be visible. Someone selecting text will still pick up the old stuff. If that's acceptable, it's quite trivial.
If the PDF was created from image, you can import it into Photoshop to edit it as an graphic. Or you can use screenshot program like "Snagit" to capture pdf page as image and use snagit's editor to erase old text and replace new one.
But this method may bring you problem is that the new added text may not the same font as text around it. Personally, I use pdf editor to replace text in pdf since the added text will be automatically fit with the original font and size.

Categories