No-break space

Hi,

We have titles that are sometimes long and break in undesireable places. We would like to be able to insert no-break spaces in the strings before they are put in a TextFrameEx.Paragraph.Portion.Text.

I have tried to do this but the no-break spaces do not seem to make it to the PowerPoint (pptx).

Any clues about where I might look or try to do would be appreciated.

Brad

Dear Brad,

I feel sorry to share that I have not been able to completely understand the issue specified by you. Can you please elaborate the problem to some more extent.

Thanks and Regards,

Hi Mudassir,

The problem was in some of the VB string handling routines. I made a work around which used the Replace function not attached to String. Also had to break up the string since I could not find a function that allowed replacement in just part of the string.

For any others that want this functionality:

Public Shared Function noBreaksAtEnd(ByVal s As String) As String

Dim cNBSpace As String = " " 'non break space

Dim cOld As Char = " " 'normal space

If s.Length > 20 Then

s = charReplace(s, cOld, cNBSpace, s.Length - 12, s.Length - 1)

End If

Return s

End Function

Public Shared Function charReplace(ByVal s As String, ByVal cOld As Char, ByVal cNew As Char, ByVal iBeg As Integer, ByVal iEnd As Integer) As String

Dim sBeg As String

Dim sMid As String

Dim sEnd As String

Dim i As Integer

sBeg = s.Substring(0, iBeg)

sMid = s.Substring(iBeg, iEnd - iBeg + 1)

sEnd = s.Substring(iEnd + 1)

'HttpContext.Current.Trace.Warn(sBeg + "-" + sMid + "-" + sEnd)

sMid = Replace(sMid, cOld, cNew)

Return sBeg + sMid + sEnd

End Function

Hi Mudassir,

Another problem has developed with the non-breaking characters (at least the hyphen).

When I create a jpg from a pptx using GetThumbnail, the non-breaking hyphens are not shown in the jpg. I am attaching an example. Notice the hyphen is missing in 'Anti-Static' in the jpg.

Brad

Hi Brad,

I have worked with the presentation file shared by you and have been able to observe the issue in the generated thumbnail. An issue with ID 25735 has been created in our issue tracking system to further investigate and resolve the issue. This thread has also been linked with the issue so that you may be automatically notified, once the issue is resolved.

We are sorry for your inconvenience.