Free Support Forum - aspose.com

Differnt Font Sizes on DocumentBuilder.Write()

When I write multiple paragraphs into my document via DoucmentBuilder.Write(string);

The first paragraph is the intended format. The rest of the paragraphs revert to the default font size.

Any ideas why this happens?

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I can’t reproduce this issue on my side. I used the following code for testing.

Document doc = new Document(@"Test151\in.doc");

DocumentBuilder builder = new DocumentBuilder(doc);

for (int i = 0; i < 10; i++)

{

builder.Writeln("Some text in paragraph");

}

doc.Save(@"Test151\out.doc");

Could you please attach your document and provide me code that will allow me to reproduce this issue?

Best regards.

First off -- you guys have amazing turn around on this forum!

Try the following code with the attached template.

Document doc = new Document(@"in.dot");

DocumentBuilder builder = new DocumentBuilder(doc);

builder.ParagraphFormat.ClearFormatting();

builder.Font.Size = 20;

StringBuilder sb = new StringBuilder();

sb.AppendLine("Line One");

sb.AppendLine();

sb.AppendLine("Line Two");

builder.Writeln(sb.ToString());

doc.Save(@"out.doc");

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. I can’t reproduce this issue on my side. I used the latest version of Aspose.Words for testing. You can download this version from here.

http://www.aspose.com/community/files/51/file-format-components/aspose.words/entry119442.aspx

Best regards.

On the unistall of the privious version the Installer throw a fatal error:

Exception occurred while initializing the installation. System.IO.FileNotFoundException: File or assembly name Aspose.Installer2.dll, or one of its dependencies was not found.

Note the version that I was running was 4.4.3

Ideas to get arround this exception to install the latest version?

Thanks!

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I never have seen this error. Anyway you don’t need to uninstall old version of Aspose.Words. Just run installer of the latest version and it will reinstall Aspose.Words on your machine. If this doesn’t help try reinstalling old version, after this install the latest.

Best regards.