Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Feb 28, 2012 3:07 pm

Hi,

I have a question regarding rtf: is it possible to embed rtf source into existing word document?

I have rtf source in format like :

{\rtf1\ansi\ansicpg1250\deff0\deflang1050{\fonttbl{\f0\fnil\fcharset238 Calibri;}{\f1\fnil\fcharset0 Calibri;}}
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\sa200\sl276\slmult1\f0\fs22 This is bold\b ovo \b0 text.\lang1033\f1\par
}

and I would like to embed it into word document so it displays:
This is bold text.

Is is possible to do that using Spire.DOC?

tbalaz
 
Posts: 4
Joined: Fri Dec 30, 2011 11:10 am

Thu Mar 01, 2012 6:40 am

Hi tbalaz,

Thanks for your inquiry.

Spire.Doc can do it conveniently. Firstly, you need to save your rtf source into a text file, and then use a stream to read it. Lastly, you create a doc document using Spire.Doc and just need use the method "doc.LoadRtf(stream)". The rtf source can display in the doc document you created earlier. I also attached you a demo, please have a look.

In case of any ambiguity,please feel free to contact us.
Have a great day.

BR
Suci
e-iceblue support
User avatar

Suvi.Wu
 
Posts: 154
Joined: Thu Oct 20, 2011 2:53 am

Thu Jun 21, 2012 7:06 am

Hi,

your example was very helpful, tnx for that.

But now we have an issue when converting rtf text to pdf. Problem is with unicode characters and is very strange. When a word contains unicode character, then the next space character is missing.

Example is in the attachment.
Part of the rtf text is "SPLIT, Stobre\'e8ka 5". That part, after opening in a Microsoft Word or WordPad looks like this:
"Stobrečka 5"
which is ok.

But when I convert that source with spire to pdf, the output is like this:
"Stobrečka5".
Notice the missing space.

It happens after any unicode character.

Can you try to reproduce the problem with the example in the attachment and see what is wrong (or what am I doing wrong)?

tbalaz
 
Posts: 4
Joined: Fri Dec 30, 2011 11:10 am

Wed Jun 27, 2012 9:34 am

Hi tbalaz,

As the issue you reported, we have created a research on it, but we need some more time to fix it. I can not provide you any reliable estimate regarding it's complexity. However, you will be surely informed once we fix it.

Thanks for your understanding and cooperation.

Have a nice day.
Nancy
e-iceblue support team
contact: nancy.wang@e-iceblue.com
User avatar

nancy
 
Posts: 51
Joined: Wed May 30, 2012 2:02 am

Return to Spire.Doc