This project has moved and is read-only. For the latest updates, please go here.

Changing document orientation

Nov 24, 2010 at 6:51 PM

I can't find any way to change the document orientation.

I found the enumeration NovaCode.Orientation contaning Portrait and Landscape but it is not used anywhere within the project and I cant seem to find anyone mentionning this subject anywhere on the website.

Also, the .chm file doesn't work on my computer. It tells me the web page is not accessible (i'm using Windows XP Professionnal SP3 French)

Nov 24, 2010 at 6:53 PM

Right click on CHM file and choose properties and then find option that the CHM is safe. This is normal for each CHM you download from internet in SP3. Hope this helps

Nov 24, 2010 at 8:46 PM
@Zumten An unofficial patch --an email-- for Orientation support was submitted by a user: Harrison Brett. This patch got forgotten because it wasn't submitted through codeplex. I will try and add it to the latest source over the weekend... I don't know how the enum made it into the source without the core functionality.
Nov 24, 2010 at 9:30 PM

Thanks a lot :) For now I can continue working on my document and apply the patch later on.

By the way, I just found a bug. When I set indentation on a paragraph using a non-natural number, the resulting file is corrupted.

It is fixed if i set the Thread's CurrentCulture to InvariantCulture.

Nov 27, 2010 at 11:50 PM

please be more specific. What do you mean by setting indentation to a
non-natural number?

Please provide an example of how to reproduce this bug.


P.S. I have just uploaded change-set: 58104 which contains support for
the orientation feature you requested, you can now set the documents
Orientation to Portrait or Landscape.
Nov 28, 2010 at 12:25 AM

When a number has digits after the dot, it is not formatted in the same way depending on the CurrentCulture:

float number = 12.34f;
number.ToString(new CultureInfo("fr-ca")); // 12,34
number.ToString(CultureInfo.InvariantCulture); // 12.34
number.ToString(new CultureInfo("en-us")); // 12.34

The following code builds an invalid Docx file:

Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-ca");
using (DocX docx = DocX.Create("test.docx"))
    docx.InsertParagraph("Some text").IndentationBefore = 0.2f;

Nov 30, 2010 at 1:56 PM

thank you for finding this bug. I doubt I would have ever found it. I do all my testing in English.

I am glad to see that DocX has reached France.

I will try and fix this issue as soon as I find time. Perhaps after work today, depends how work goes.