Welcome GuestLogin

PDFsharp and MigraDoc Wiki

RSS RSS

Navigation




Quick Search
»

PoweredBy
A space is a space is a space.
But not all spaces are equal. And they do not always behave as you expect.

Spaces in MigraDoc

MigraDoc documents can persist in text files (MigraDoc DDL (MDDDL) format). To make these files readable for humans, the files can contain line breaks and indentation.

When MigraDoc renders a document, multiple spaces will be treated as one because the spaces could just be the result of indentation in an MDDDL file. This is very similar to HTML where indentation can also be used to make a nice source file, but extra space is ignored by the browser during rendering.

How can I get extra spacing?

There are different ways that may or may not work, depending on what you try to achieve.

Often you can get what you want by using indentation and tab stops.

Non-breaking Spaces

Multiple non-breaking spaces will never be collapsed to a single space, so you can use that to get extra spacing.

But there is a drawback: Non-breaking spaces (NBSP) will not get broken, as the name applies. If you place three NBSP between two words, the layout routine will treat this as one long word, so both words will always be on the same line.

Indentation

A common task: you want to create a bullet list and want to have extra space before and after the bullet.

The right way to achieve this: use left indentation for the body text, use a negative indentation for the first line to position the bullet, set a tab stop in line with the left indentation and add a tab after the bullet.


Miscellaneous
Home
PDFsharp
FAQ
Samples
Articles
MigraDoc
FAQ
Samples
Articles

ScrewTurn Wiki version 3.0.5.600. Some of the icons created by FamFamFam.

Impressum - Legal Notice