PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Apr 26, 2024 11:50 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Aug 22, 2014 7:05 pm 
Offline

Joined: Wed Mar 06, 2013 3:53 pm
Posts: 22
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 389 times
Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 25, 2014 2:36 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
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.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 25, 2014 6:57 pm 
Offline

Joined: Wed Mar 06, 2013 3:53 pm
Posts: 22
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 325 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group