diff --git a/src/main/java/writer2latex/xhtml/content/TextParser.java b/src/main/java/writer2latex/xhtml/content/TextParser.java
index 06f702d..14316ef 100644
--- a/src/main/java/writer2latex/xhtml/content/TextParser.java
+++ b/src/main/java/writer2latex/xhtml/content/TextParser.java
@@ -1776,6 +1776,9 @@ public class TextParser extends Parser {
inHeader = true;
MasterPage masterPage = ofr.getFullMasterPage(currentMasterPage);
if (currentMasterPage != null) {
+ String pageLayoutName = masterPage.getPageLayoutName();
+ PageLayout pageLayout = ofr.getPageLayout(pageLayoutName);
+ String marginBottom = pageLayout.getFooterProperty(FO_MARGIN_BOTTOM);
if (pageNum % 2 == 0) {
headerNode = masterPage.getHeaderLeft();
}
@@ -1785,6 +1788,9 @@ public class TextParser extends Parser {
if (headerNode != null) {
//Create header element
Element headerElement = converter.createElement("header");
+ if (marginBottom != null) {
+ headerElement.setAttribute("style", "margin-bottom:"+getPageSc().scale(marginBottom)+";");
+ }
Node pageNode = node.getParentNode();
pageNode.insertBefore(headerElement, node);
traverseBlockText(headerNode, headerElement);
@@ -1801,6 +1807,9 @@ public class TextParser extends Parser {
inFooter = true;
MasterPage masterPage = ofr.getFullMasterPage(currentMasterPage);
if (currentMasterPage != null) {
+ String pageLayoutName = masterPage.getPageLayoutName();
+ PageLayout pageLayout = ofr.getPageLayout(pageLayoutName);
+ String marginTop = pageLayout.getFooterProperty(FO_MARGIN_TOP);
if (pageNum % 2 == 0) {
footerNode = masterPage.getFooterLeft();
}
@@ -1810,6 +1819,9 @@ public class TextParser extends Parser {
if (footerNode != null) {
//Create footer element
Element footerElement = converter.createElement("footer");
+ if (marginTop != null) {
+ footerElement.setAttribute("style", "margin-top:"+getPageSc().scale(marginTop)+";");
+ }
Node pageNode = node.getParentNode();
pageNode.appendChild(footerElement);
traverseBlockText(footerNode, footerElement);