XAML / FlowDocument support

I couldn’t find accurate information concerning XAML / Flow Document support. Is it yet supported as announced in older posts from last year? I couldn’t find information on the product page, it states that only xps is supported.

Thanks for your help

Marc

Hi

Thank you for your interest in Aspose.Words. Please follow the link to learn more about XAML in Aspose.Words:
https://blog.aspose.com/2010/09/14/do-you-want-xaml-export-in-aspose-words/

Please let us know how you would like to use XAML. Your feedback is highly appreciated.

Best regards,

Hello!

Although this thread is a bit out of date, it is relevant (for us, at least :).

The issue of converting Word document into a Flow document is essential, and imperative in our project.

The lastest version (downloaded yesterday) seems to enable conversion to Xaml(Fixed), which would be a good start (until the XamlFlow is officially released), however, there seems to be a lot of elements which are not beign converted, like Images, WordArt, etc’…

Am i doing something wrong in the conversion, or is this a known issue?

Suggestions & Information would be appriciated!

Regards

Ethan

Hi

Thanks for your request. Could you please attach your input and output documents here for testing? I will check the issue and provide you more information.

Best regards,

Hi,

The 2 files are in the Zip attached.

awaiting your reply.

Hi

Thank you for additional information. You are converting to XAML Flow. Currently, Aspose.Words outputs only text into XAML Flow format.

If you save the document in XAML Fixed, the output document looks as expected:

Document doc = new Document(@"Test001\TestThisForConversion.docx");
doc.Save(@"Test001\out.xaml", SaveFormat.XamlFixed);

Best regards,

Seems you are correct, Flow indeed converts words only.

Why is this, and when will it be resolved?

The goal is indeed to convert to Flow, rather than Fixed, due to the structure of our app…

Can u help in any way?

Is there an updated (Beta?) version, or any other way of preserving the ability to convert “advanced” word elements, while maintaining ‘Flow’-Mode?

Hi

Thanks for your request. Unfortunately, currently there is no way to preserve images and other advanced component upon converting to Flow XAML.

You can try creating your own converter to XAML. You can use DocumentVisitor to achieve this. Please follow the link for more information:
https://docs.aspose.com/words/net/how-to-extract-selected-content-between-nodes-in-a-document/

Best regards,

Thanks for the reply!

I noticed the new folder created by the Save Method, however, there are no URI packs and/or any other way of “binding” the Images in the document to the folder…

Can this be done automatically by the process?

Also, Is there a way of Embedding the pictures in the xaml?

I know technically there should be a way, but can we do it during the conversion?

Hi

Thanks for your request. Unfortunately, there is no way automatically embed images into XAML. Maybe in your case, you can use XPS instead of XAML. You can easily display XPS document in your WPF application and in this case, all resources like images and fonts are inside XPS document.

Best regards,

Hi,

You are Correct, However we need the ability to inject elements to the Xaml, after conversion, and retrieve certain elements from the Xaml, so xps is out of the question, I’m afraid.

Are you familiar with XamlPackage? can u embbed it into the code so we can achive the goal- ‘independent xaml’ ?

Also, i came across another thread here, https://forum.aspose.com/t/70190

I thought this code could help, so i tried running this code, but it fails during “re-parsing”:

the line: FixedDocument fixedDoc = (FixedDocument)XamlReader.Parse(xamlString, context); fails.

Weird, but judging by the error that happens because of the 3 dots in the cloud (beginning of the original Docx)

Furthermore, if you remove the dots, the error changes, and is now “object reference…”

Could this code be of any help at all? Can you help with the errors? seems something in the conversion is not right…

Please advise

Hi

Thanks for your request. I am not familiar with XamlPackage, but it sounds like Xaml with embedded resources. Am I right? If so this might be an interesting save option for Fixed Xaml. Could you please attach an example of Xaml package here? I simply failed to find a specification for this format. I will investigate and let you know if it is possible to implement.

Best regards,

You are correct,

you can find information regarding this topic at msdn/MS sites, i.e https://social.msdn.microsoft.com/Forums/en-US/ac168aab-9a02-4153-a0f8-59905ba78cee/flowdocument-format-xaml-and-xamlpackage.

If indeed Aspose will provide a save Method with XamlPack, that will b helpfull!

Regards

Hi

Thank you for additional information. We will investigate whether it is possible and provide you more information.

Best regards,

Hi

Thanks for your request. I investigated a capability. We can add such save format. But XAML package is an option only for flow XAML. Doe fixed XAML we have XPS format, which is actually a XAML package for FixedDocument.

Not sure we will provide this save format in the next version of Aspose.Words. but we will let you know once it is available.

Best regards,

Terrific!

When do you think you will have it ready?

Hello

Thanks for your request. This issue is scheduled on the end of September. You will be notified as soon as it is avaliable.

Best regards,

Hi

Do you have any news regarding support of wordml to flowdoc conversion?

Thanks

Hod

Hi Hod,

Thanks for your request. We are working on this issue right now. Currently in our code base we support basic text and paragraph formatting and basic tables. Hopefully, we will release the next iteration of XAML in February or March release.

Best regards,