PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.de/

Non Breaking Spaces not working in RTF
http://forum.pdfsharp.de/viewtopic.php?f=2&t=2909
Page 1 of 1

Author:  briankitt [ Fri Aug 22, 2014 7:05 pm ]
Post subject:  Non Breaking Spaces not working in RTF

I have cases where I need extra spacing in my text. Of course with proportional fonts, these are often squeezed out. So I wanted to use 'non breaking spaces'. I was under the impression that \xA0 was a non breaking space. It does work perfect in PDF, but it does not work in RTF. What is the proper non breaking space to use so that both formats work properly?

I do a AddParagraph("R E M I T T A N C E" + String.Empty.PadRight(3, '\xA0') + "C O P Y")

It works perfect in PDF, but this is what I get in RTF? See attached

Attachments:
Sample.zip [12.95 KiB]
Downloaded 396 times

Author:  Thomas Hoevel [ Mon Aug 25, 2014 2:36 pm ]
Post subject:  Re: Non Breaking Spaces not working in RTF

You attached a Word document, not an RTF file.

Our application allows to enter non breaking spaces using Alt+<255> or Alt+<0160> (that is 0xA0).

This works fine, also for RTF documents - and also after conversion to DOCX.

I don't know what went wrong with your file - I cannot tell from the code snippet, the problem is probably somewhere else.

Author:  briankitt [ Mon Aug 25, 2014 6:57 pm ]
Post subject:  Re: Non Breaking Spaces not working in RTF

I apologize. You were correct. It was something that I broke.

In my process, I am attempting to merge the RTF documents into a single document. In that process, the file type changes from UTF-8 to non encoded. Once it does that, the \xA0 changes to garbage. So you are right, I was doing it.

Sorry about my sample, I had opened it with Microsoft Word to verify that it was garbled before I sent it to you, and I then uploaded it as a Word document, rather than the RTF document that was generated.

This is resolved now. Now, if only I can get the merge of the RTF documents, I'm set! I'll be sending you a donation for all of your help, I really appreciate it.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/