We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Insert FlowDocument into WordDocument

Hello,

I've formatted text in form of a FlowDocument, this text I'd like to insert into a WordDocument. Is there any easy way to accomplish this and if not, is there a known workaround that works?

Thanks for the help!

8 Replies

MA Markus March 15, 2010 10:16 AM UTC

Hello,

since there is no answer, i think the docio can't handle this issue directly.

Is there any alternative solution?
E.g.:
I can copy from an richtextbox (WPF) and paste the formatted text into word. All works.
Is it possible to "simulate" that copy&paste with your docio?

Or are there better ways to insert _formatted_ text into a special placeholder in WordDocument. For simple text it works, but we really need formatted text (e.g. bold, numbering etc.).

If there is no solution, we have to switch to other components, sorry.

Best regards
Markus


VS Vijayakumar S Syncfusion Team March 15, 2010 12:16 PM UTC

Hi Markus,

We regret for the delay in responding.

Currently Essential DocIO does not provide support for reading FlowDocuments/RTF contents. Currently DocIO has only provide support for saving as RTF document and not for reading RTF documents. We have a plan to implement this feature for converting RTF into Word document and this feature might be a part of our 2010 volume 3 release. Once this feature is implemented, you are able to read the FlowDocuments through DocIO. We are sorry for the possible inconvenience caused.

We recommend you, to raise your queries through Direct Trac Developer Support System https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well.

Regards,
Vijay


MA Markus March 15, 2010 01:08 PM UTC

Thanks for your answer.
If we won't find a way to cast a formatted text into doc, we we won't be able to use your docio, sorry.

Best regards
Markus


VS Vijayakumar S Syncfusion Team March 15, 2010 06:55 PM UTC

Hi Markus,

Thank you for your update.

We have prepared a sample to convert Flow document into Word document by converting the FlowDocument into HTML contents and then the html contents is converted into word document using DocIO. Could you please have a look at the sample from the below link and let us know if this helps. The routine used for converting the FlowDocument into HTML codes are referred from the below msdn link.

XAML to HTML Conversion Demo:
http://msdn.microsoft.com/en-us/library/aa972129.aspx

Sample link:
http://help.syncfusion.com/support/DocIO.Windows/F93234/FlowDocumentToWordDocument.zip

Please let us know if you have any questions.

Regards,
Vijay


MA Markus March 16, 2010 11:05 AM UTC

Hi Vijay,

thanks again for your help.
I tried your sample and ...
it works.
Not perfect but it does a good job (about 80%). Some formattings seem to be a problem, e.g. List in Lists.
But we give it a try and i will update you.

Regards
Markus


MA Markus March 18, 2010 09:13 AM UTC

One Update from my side:

We tested you sample code and got the followng error
after this line of code: paragraph.AppendHTML(htmltext);

"List level must be less 8 and greater then 0".

The input xaml which is converted to html:
http://schemas.microsoft.com/winfx/2006/xaml/presentation"> Margin="0,0,0,0" TextAlignment="Left" FontFamily="Tahoma[,Arial]" FontSize="14" xml:lang="de-de" NumberSubstitution.CultureSource="User">this is a testnumber1number2testtest2

The output html after converting from xaml (seems to be valid and can be opened in firefox):

this is a test

  • number1

  • number2

  1. test

  2. test2



Did we make anything wrong?
Is there a workaround?

Regards
Markus




MA Markus March 18, 2010 09:34 AM UTC

Hi Vijay,

something like this works fine.

this
is a test




Seems to be only a problem of Lists.

Best regards
Markus

PS: Could you please delete the stacktrace of my last post, there are relevant data in it. Posted to fast :)


PR Poornima R Syncfusion Team March 23, 2010 06:48 AM UTC

Hi Markus,

Thank you for your update.

We are sorry for the long delay in responding. We were able to reproduce the mentioned issue.We suspect this could be a defect. We have forwarded this issue to our development team for further analysis.

Could you please report this issue through Direct Trac Developer Support System (http://www.syncfusion.com/Account/Logon ReturnUrl=%2fsupport%2fdirecttrac), because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Please let me know if you have any queries.

Regards,
Poornima

Loader.
Live Chat Icon For mobile
Up arrow icon