Free Support Forum - aspose.com

Regarding The Character Set In Aspose Slides

Received : 2007/11/05 00:56:48
Message : Hi,
I had a problem regading the character sets supported by Aspose Slides.

Here is the piece of text that i copied from MSWord and which is included in the PPT generated ( by Aspose Slides).

“Double Quotes”

But in the slides the following is shown up

“Double Quotes”








This message was posted using Aspose.Live 2 Forum

Dear Bijesh,

Thanks for considering Aspose.Slides for .NET

To add quotation marks, you need to use escape sequence, you cannot add it directly. For example in C#, you will use

textFrame.Text="This is a quotation mark \". ";

And in VB.NET

textFrame.Text="This is a quotation mark "". ";

Please also see this code and the output presentation generated by it, which I have attached.

Code - C#

***********************************************************************************

Presentation srcPres = new Presentation();

Slide srcSld = srcPres.GetSlideByPosition(1);

//Create a rectangle and hide its lines

Aspose.Slides.Rectangle rect = srcSld.Shapes.AddRectangle(300, 400, 5000, 1);

rect.LineFormat.ShowLines = false;

//Create a text box by adding textframe inside rectangle

TextFrame tf = rect.AddTextFrame("");

//Textframe will automatically wrap any line that exceeds its width

tf.WrapText = true;

//Textframe will grow the rectangle height if requires

tf.FitShapeToText = true;

//Add some text using TextFrame.TextProperty

tf.Text="\"Double Quotes\"";

//Add some text using Paragraph

//Clone the previous paragraph and change its text, and then add it

Paragraph para = new Paragraph(tf.Paragraphs[0]);

para.Text = "\"Double Quotes using Paragraph\"";

tf.Paragraphs.Add(para);

//Add some text using Portion

//Clone the previous portion inside the newly added paragraph, and change its text

//and then add it

Portion port = new Portion(para.Portions[0]);

port.Text = " \"Double Quotes using Portion\"";

para.Portions.Add(port);

//Write the presentation on disk

srcPres.Write(@"c:\outPres.ppt");