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

Free Support Forum - aspose.com

Proper representation of the symbols

hello,

Sorry to bother... I (finally) purchased the slides project - it's GREAT! Just have one issue that I have been spending hours on and simply CANNOT figure it out yet... is there anyone who can help?

Well, here's the issue. I am creating slide notes... then populating it with paragraphs and text. This text can contain some symbols (like „ and degree symbols, etc.) If I just place that in the notes, it comes out looking like a black diamond with a question mark. How do I insert this text and ensure proper representation of the symbols?


This message was posted using Email2Forum by salman.sarfraz.

Dear codewhispere,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for purchasing Aspose.Slides for .NET.

Can you please show me your code and source presentation?

I am able to add character and it appeared fine, please see my code and output presentation, I have attached.

C# Code

Presentation pres = new Presentation();

Slide sld = pres.GetSlideByPosition(1);

//adding character „

Notes notes = sld.AddNotes();

notes.Text = "like „ and ";

pres.Write("c:\\out.ppt");

Here is an example of the text I would try to add:

(at 8„eMIC) against\rthis is a second paragraph

Here is the VB code snippet (after adding a new slide to a presentation…)
= = = = = = = = = = = = = = = = = = = = = = = = = = =
Dim slidex As Slide
Dim aryNotes As Array
Dim newnote As Aspose.Slides.Notes
Dim newpara As Aspose.Slides.Paragraph

slidex = pres.AddEmptySlide()

slidex.AddNotes()
newnote = slidex.Notes

’ My text has embedded ‘\r’ to indicate new paragraph, so I split
’ apart the string and add new paras as necessary
slidenote = Replace(slidenote, “\r”, vbCrLf)
aryNotes = Split(slidenote & vbCrLf, vbCrLf)

For intX = 0 To UBound(aryNotes)
If intX = 0 Then
newnote.Paragraphs(0).Portions(0).Text = aryNotes(intX)
Else
Dim newpartext As New Paragraph(newnote.Paragraphs(0))
newnote.Paragraphs.Add(newpartext)
newpartext.Portions(0).Text = aryNotes(intX)
End If
Next
= = = = = = = = = = = = = = = = = = = = = = = = = = =


When I would then look at the resulting PPT file in PowerPoint, the slide notes would look like this:


(at 8eMIC) against

this is a second paragraph

except that the '
’ character would be a black diamond with a question mark in the middle of it (I don’t know how to represent it here)


This is the ppt, I have generated with your code with little modifications to run it. As you can see in notes of second slide, there is no problem. I have used Aspose.Slides 2.8.4.0

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Dim pres As New Presentation

Dim slidex As Slide

Dim aryNotes As Array

Dim newnote As Aspose.Slides.Notes

Dim newpara As Aspose.Slides.Paragraph

Dim slidenote As String = "(at 8„eMIC) against\rthis is a second paragraph"

Dim intX As Integer

'This is second slide

slidex = pres.AddEmptySlide()

slidex.AddNotes()

newnote = slidex.Notes

' My text has embedded '\r' to indicate new paragraph, so I split

' apart the string and add new paras as necessary

slidenote = Replace(slidenote, "\r", vbCrLf)

aryNotes = Split(slidenote & vbCrLf, vbCrLf)

For intX = 0 To UBound(aryNotes)

If intX = 0 Then

newnote.Paragraphs(0).Portions(0).Text = aryNotes(intX)

Else

Dim newpartext As New Paragraph(newnote.Paragraphs(0))

newnote.Paragraphs.Add(newpartext)

newpartext.Portions(0).Text = aryNotes(intX)

End If

Next

pres.Write("c:\outNotes.ppt")

This is so frustrating! Thanks for all the advice… but I’m still trying here… with a slightly different twist. I have some text that is represented in HTML-style that I am placing in the notes. Here is an example of the text:

The height was ≥ 10 feet…

(in case this forum and/or your browser changes the representation here, the above would read aloud as "The height was ampersand-octothorpe-eight-eight-zero-five-semicolon 10 feet…"

So in a browser (and in the old method I used for creating the PPT file - which was using an HTA), it would insert the correct symbol for ‘greater than or equal to’, which looked like ≥.

Obviously, when I insert this test as a note I see the actual ampersand-octothorpe code in the text, which I pretty much expect, since the notes are not considered to be HTML. However, when I replace the text for the note with the actual symbol (e.g. The height was ≥ 10 feet… ), instead of the symbol itself I get an ‘equals’ sign.

How can I get the actual symbol I wanted? Is this some sort of double-byte issue? or encoding issue? or ??


Never mind… found it… it was the double-byte thing on the input file. I got that fixed and then the notes function worked just great.

Thanks!