We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Format page setup conflicts with TextColumnCollection on .ODT format

Hi!
Trying build a report and output in .ODT format. Simple process: load text / csv into a document, set few page setup properties, split in 3 columns by using TextColumn feature and save the file. Code below:

feed = $"{pathToTemp}Street_Index.csv";
repName = $"{pathToTemp}{ReadDocPathDetails().First()}.odt";

Document doc = new Document(feed);
DocumentBuilder builder = new DocumentBuilder(doc);
PageSetup pageSetup = builder.PageSetup;

pageSetup.Orientation = Orientation.Landscape;
pageSetup.TopMargin = ConvertUtil.MillimeterToPoint(15);

TextColumnCollection columns = pageSetup.TextColumns;
columns.SetCount(3);
columns.EvenlySpaced = true;
columns.Spacing = 40;
doc.Save(repName);

It doesn’t apply neither, splitting into columns or changing the page setup format. If i change the extension to .docx is outputting the correct changes.
If i comment out TextColumn functionality it works to style the page setup. Tried to change the page setup formatting to come after textColumn snippet but still no effect

@Remus87 Could you please attach your input and output documents here for our reference? I have checked the functionality with the following simple code and the generated documents looks correct:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Put some test content.
for (int i = 0; i < 100; i++)
    builder.Writeln("This is a test paragraph.");

PageSetup pageSetup = builder.PageSetup;

pageSetup.Orientation = Orientation.Landscape;
pageSetup.TopMargin = ConvertUtil.MillimeterToPoint(15);

TextColumnCollection columns = pageSetup.TextColumns;
columns.SetCount(3);
columns.EvenlySpaced = true;
columns.Spacing = 40;

doc.Save(@"C:\Temp\out.odt");
doc.Save(@"C:\Temp\out.docx");

out.zip (10.3 KB)

I attach the input (.csv) and output (.odt) below

InputOutput.zip (15.2 KB)

@Remus87 As I can see your output document has 3 columns as expected. I have checked the document in LibreOffice and OpenOffice on my side. What application do you use to view your ODT document?

Hi ! and thanks for looking into the issue.
Indeed was testing only in M. Word but when tested the document in LibreOffice it displayed first same (see attached picture) and an extra object (Aspose logo picture) on main focus. Removed the object, saved and closed the process. Opened the document again and this time displayed the 3 columns, so i think is because we’re using still the demo version which might have these limitations (we’ve temporarily testing for a short period to check if fits our requirements but had to postpone due to other priority projects and now came back on completing the last test cases)RunningSample_in_LibreOffice.PNG (68.2 KB)

@Remus87 Thank you for additional information. I have managed to reproduce the problem with evaluation watermark in ODT and logged it as WORDSNET-23890. We will keep you informed and let you know once it is resolved.

Thanks for the update. Will wait for the further feedback.

1 Like

The issues you have found earlier (filed as WORDSNET-23890) have been fixed in this Aspose.Words for .NET 22.7 update also available on NuGet.