I have a DOCX template with mirror margins (MirrorMargins
) configured. I populate the template using Aspose.Words’ built-in ReportingEngine
with the following code:
csharp
ReportingEngine engine = new ReportingEngine();
Document doc = new Document(templatePath);
engine.BuildReport(doc, model, "model");
The mirror margins are correctly applied during the filling process. During debugging, I can see that the section properties (Section
) have the value PageSetup.MultiplePages = MultiplePagesType.MirrorMargins
, confirming that the mirror margins are properly set in the document.
Additionally, I tested creating a new document using DocumentBuilder
, where the mirror margins are also set via PageSetup.MultiplePages
. In both cases, the mirror margins work correctly during generation.
In my understanding, mirror margins are alternating margins applied to odd and even pages. This means that on odd pages, the left margin is larger and the right margin is smaller, while on even pages, it is the reverse. When saving the document as PDF or RTF, the mirror margins work perfectly, displaying correctly. However, when saving the document as ODT, they are not reflected in the file: the styles.xml
file lacks the critical node style:page-usage="mirrored"
, which is responsible for rendering mirror margins in ODT.
Perhaps I am misunderstanding something, and mirror margins need to be configured differently for ODT. If so, I would greatly appreciate clarification or guidance.