This project has moved. For the latest updates, please go here.

Changing document orientation

Nov 24, 2010 at 5: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)

Developer
Nov 24, 2010 at 5: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

Coordinator
Nov 24, 2010 at 7: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 8: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.

Coordinator
Nov 27, 2010 at 10:50 PM
Zumten,

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.

Regards,
Cathal

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 27, 2010 at 11:25 PM

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;
    docx.Save();
}

Coordinator
Nov 30, 2010 at 12:56 PM
zumten,

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.

Regards,
Cathal