ParagraphFormat.Alignment ignored

Hi

In all your 3.x versions I find that ParagraphFormat.Alignment is being ignored. This even happens in the demos that come with the component. I noticed a thread in the forum from last year with the same problem, but it seemed to be fixed in that thread. Have you any idea why this is happening again?

Thanks

In fact, now that I think about it, all of the ParagraphFormat properties are being ignored. Is this something you are aware of and working on, as my client has already purchased the component, and will be expecting a finished product in the next few days.

Thanks

Please tell me how they are being ignored. What do you do with the document and what is your code like.

Well here is some code from the demos that come with the component.

//Specify paragraph formatting before calling InsertParagraph or Writeln.
builder.ParagraphFormat.Borders[BorderType.Top].LineStyle = LineStyle.Double;
builder.ParagraphFormat.Borders[BorderType.Top].LineWidth = 2;
builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;
builder.ParagraphFormat.Shading.ForegroundPatternColor = 
System.Drawing.Color.Azure;
builder.ParagraphFormat.Shading.Texture = TextureIndex.TextureSolid;
builder.ParagraphFormat.LeftIndent = 2 \* 72; //2 inchdes by 72 points.
builder.ParagraphFormat.SpaceBefore = 12;
builder.ParagraphFormat.SpaceAfter = 12;
builder.Font.Name = "Arial";
builder.Font.Size = 12;
builder.Write("This fragment demonstrates use of paragraph formatting to specify ");
builder.Writeln("alginment, spacing, borders and shading.");
builder.ParagraphFormat.ClearFormatting();

The ParagraphFormat.Alignment is not being set. It doesn’t matter what I set it to, the text is always left aligned.

I may have been a bit hasty saying that they all were being ignored. It was just something else I noticed, but it seems they are working, except for alignment.

Hi,

I’ve just produced a document using the Document Builder demo and everything works for me (see attached). What version of Microsoft Word are you using?

Have you been able to change the alignment of the paragraph that reads

This fragment demonstrates use of paragraph formatting to specify alginment, spacing, borders and shading.

For me, its always left aligned, no matter what I set the alignment to. I’m using Word 2000 9.0.3821.

Please attach the document produced by the Document Builder demo on your side. We will compare it with our one.

By the way, did the problem start when you updated to Aspose.Word 3.x or you had it with 2.x as well?

Please find the document attached. This is with a setting of ParagraphAlignment.Center, the default in the Document Builder demo.

I have never used any version of Aspose.Word below the 3.x versions, so I don’t know if the problem existed in the 2.x versions.

The file is almost 10K larger than produced here… Didn’t you open/save it in Word 2000 before sent?

I selected DOC as the output format from the Featured Demos page, and then saved the output straight from the browser. I opened it in Word 2000 before I sent it to make sure it was valid, but I didn’t save it again from there.

Incidentally, the alignment seems to work in your viewer beta.

Thanks, we are investigating the issue.

Thanks. We really require a quick turn around for this if at all possible, as the product needs to be released on friday.

I am experiencing the same problem with word 2000. Whenever I open it with 2003 the document seems to be fine.

Hi

Can you give me an update as to when you think this problem might be fixed? I’m up against it time wise, so even if I can get an ETA I’ll at least know where I stand.

Thanks.

Hi,

We have recently released v3.1.1, please try it.

  • Fixed paragraph alignment ignored by MS Word 2000 in files created with DocumentBuilder

https://docs.aspose.com/words/net/release-notes/

Great, that seems to have fixed it. Thanks for your help.

Hi

We have a similar problem regarding ParagraphAlignment being ignored.

For some reason or another, when I specify that I want the text left aligned:

MyReader.Read()
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left
builder.InsertBreak(BreakType.LineBreak)
builder.Font.Bold = True
builder.Write("Comments")
builder.Font.Bold = False
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left
builder.InsertBreak(BreakType.LineBreak)
builder.Writeln("(" + CType(MyReader("User Name"), System.String) + "[" + CType(MyReader("Date Entered"), System.String) + "])")
builder.InsertBreak(BreakType.LineBreak)
builder.InsertHtml(CType(MyReader("Comments"), System.String))
builder.InsertBreak(BreakType.LineBreak)

some parts of the text get centered???

As you can see I have applied the left alignment to the text before I apply the text when building the document. I even tried applying the left alignment after I already applied the text but it made no difference.

Also, the text that is being applied to the document is originally left aligned.

Thanks

Hi,

Do you use Word 2000 as well? Have you installed the latest version of Aspose.Word?