We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Visio File to Text File conversion

Greetings,



Is it possible to generate a text file out of the contents of the Visio file using Aspose SDK? If yes, then can you kindly share a code snippet that I can use?


Regards,

Syed.

Hi,

I was able to pull the text out of the shapes collection of each page. I can see that the Text property of each shape returns a formatted text string. Is it possible only to access the content of the shape without the formatting?

Looking for an urgent reply.

Regards,
Syed.

Hi Syed,

You can use the following code to extract plain text.

FormatTxtCollection collection = shape.Text.Value;<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

System.Text.StringBuilder plainText = new StringBuilder();

foreach (object text in collection)

{

if (text is Txt)

{

plainText.Append((text as Txt).Value);

}

}

Console.WriteLine(plainText.ToString());

Please feel free to contact us in case you have further comments or questions.

Best Regards,

Thank you Ijaz. This worked.