From 8ba0558822377c38af3eb5790d0c665262bc8c3a Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 13:33:08 +0530
Subject: [PATCH 01/30] Update pom.xml
---
.../fr.opensagres.xdocreport.itext.extension/pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml
index 33d133f17..fba6ef8a9 100644
--- a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml
+++ b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml
@@ -8,9 +8,9 @@
fr.opensagres.xdocreport.itext.extension
- com.lowagie
- itext
- 2.1.7
+ com.github.librepdf
+ openpdf
+ 1.3.13
bcmail-jdk14
@@ -52,4 +52,4 @@
-
\ No newline at end of file
+
From f9a769c0a01303d665e1447405013be0cbd871f0 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 13:34:07 +0530
Subject: [PATCH 02/30] Update pom.xml
---
.../fr.opensagres.xdocreport.itext.extension/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml
index fba6ef8a9..53fd02019 100644
--- a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml
+++ b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml
@@ -3,7 +3,7 @@
fr.opensagres.xdocreport
thirdparties-extension
- 2.0.2
+ 2.0.2.1
fr.opensagres.xdocreport.itext.extension
From 66313d3bc0fba3b1568cf5d907e9cfe91a0aa8ef Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 13:35:05 +0530
Subject: [PATCH 03/30] Update pom.xml
---
.../fr.opensagres.odfdom.converter.pdf/pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/pom.xml b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/pom.xml
index e08898d15..b8c7a718d 100644
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/pom.xml
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/pom.xml
@@ -15,7 +15,7 @@
fr.opensagres.xdocreport
fr.opensagres.xdocreport.itext.extension
- 2.0.2
+ 2.0.2.1
-
\ No newline at end of file
+
From cbd3875c9e508c00f2c8e2e6c53a3d4dc0064c8f Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 13:35:43 +0530
Subject: [PATCH 04/30] Update pom.xml
---
.../fr.opensagres.poi.xwpf.converter.pdf/pom.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/pom.xml b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/pom.xml
index 8f8c64fa2..6b33bab4e 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/pom.xml
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/pom.xml
@@ -3,7 +3,7 @@
thirdparties-extension
fr.opensagres.xdocreport
- 2.0.2
+ 2.0.2.1
fr.opensagres.poi.xwpf.converter.pdf
@@ -15,7 +15,7 @@
fr.opensagres.xdocreport
fr.opensagres.xdocreport.itext.extension
- 2.0.2
+ 2.0.2.1
-
\ No newline at end of file
+
From 6d08e8072b49e1b33dd3b98be9d4820b48c82348 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 13:36:15 +0530
Subject: [PATCH 05/30] Update pom.xml
---
.../fr.opensagres.odfdom.converter.pdf/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/pom.xml b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/pom.xml
index b8c7a718d..de2501e31 100644
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/pom.xml
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/pom.xml
@@ -4,7 +4,7 @@
fr.opensagres.xdocreport
thirdparties-extension
- 2.0.2
+ 2.0.2.1
From 689d910a243f559c483fdc575c998d924a210032 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 13:38:55 +0530
Subject: [PATCH 06/30] Update StyleTableCell
Commenting on the default setting of the padding in the table cell
---
.../xwpf/converter/pdf/internal/elements/StylableTableCell.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/elements/StylableTableCell.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/elements/StylableTableCell.java
index 74e0768ad..ce07c4a7d 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/elements/StylableTableCell.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/elements/StylableTableCell.java
@@ -52,7 +52,7 @@ public StylableTableCell( StylableDocument ownerDocument, IITextContainer parent
getColumn().setAdjustFirstLine( false );
// make a room for borders
setUseBorderPadding( true );
- setPadding( 0 );
+ // setPadding( 0 );
}
public StylableTableCell( StylableDocument ownerDocument, IITextContainer parent, ExtendedPdfPTable table )
From 5814edc409e8ca51d8ab7343e28da71c915cfc56 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 13:40:43 +0530
Subject: [PATCH 07/30] Update PdfMapper.java
Adding condition to check the bottom padding greater than 0
---
.../opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
index eeed19290..a39a79354 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
@@ -1265,7 +1265,7 @@ protected IITextContainer startVisitTableCell( final XWPFTableCell cell, IITextC
marginBottom = stylesDocument.getTableMarginBottom( table );
}
}
- if ( marginBottom != null )
+ if ( marginBottom != null && marginBottom > 0)
{
pdfPCell.setPaddingBottom( marginBottom );
}
From 8d7516c65ecf34fd86fce3c73e5792d3d85bd31b Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 14:16:14 +0530
Subject: [PATCH 08/30] Update pom.xml
Changing the poi version to make it compatible with the current version of the project
---
.../fr.opensagres.poi.xwpf.converter.core/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/pom.xml b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/pom.xml
index c8e5689d8..ec2e29384 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/pom.xml
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/pom.xml
@@ -10,7 +10,7 @@
org.apache.poi
poi-ooxml
- 4.0.1
+ 3.11
From 4451ce867b54493e3850d6a50bef9fff5fbe5123 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 14:30:27 +0530
Subject: [PATCH 09/30] Update XWPFStylesDocument.java
Changing package as making poi version 3.11
---
.../poi/xwpf/converter/core/styles/XWPFStylesDocument.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/XWPFStylesDocument.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/XWPFStylesDocument.java
index 278df11d2..da7e78c2e 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/XWPFStylesDocument.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/XWPFStylesDocument.java
@@ -35,7 +35,7 @@
import java.util.List;
import java.util.Map;
-import org.apache.poi.ooxml.POIXMLDocumentPart;
+import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.UnderlinePatterns;
import org.apache.poi.xwpf.usermodel.VerticalAlign;
From 823868fe34a825e314b55ab6ae92e5be71fa003c Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 14:33:48 +0530
Subject: [PATCH 10/30] Update PdfConverterTestCase.java
Changing due to poi version 3.11
---
.../org/apache/poi/xwpf/converter/pdf/PdfConverterTestCase.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/test/java/org/apache/poi/xwpf/converter/pdf/PdfConverterTestCase.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/test/java/org/apache/poi/xwpf/converter/pdf/PdfConverterTestCase.java
index b6335d6b4..c8823ee79 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/test/java/org/apache/poi/xwpf/converter/pdf/PdfConverterTestCase.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/test/java/org/apache/poi/xwpf/converter/pdf/PdfConverterTestCase.java
@@ -29,7 +29,7 @@
import java.io.IOException;
import java.io.OutputStream;
-import org.apache.poi.openxml4j.util.ZipSecureFile;
+//import org.apache.poi.openxml4j.util.ZipSecureFile;
import org.apache.poi.xwpf.converter.core.AbstractXWPFPOIConverterTest;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
From 628377ec5952cd480506d3a2e749fe7af9e8085d Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 14:36:01 +0530
Subject: [PATCH 11/30] Update XHTMLConverterEmbedImgTest.java
Changing due to poi version 3.11
---
.../poi/xwpf/converter/xhtml/XHTMLConverterEmbedImgTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.xhtml/src/test/java/org/apache/poi/xwpf/converter/xhtml/XHTMLConverterEmbedImgTest.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.xhtml/src/test/java/org/apache/poi/xwpf/converter/xhtml/XHTMLConverterEmbedImgTest.java
index 9328265e8..db3975c2e 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.xhtml/src/test/java/org/apache/poi/xwpf/converter/xhtml/XHTMLConverterEmbedImgTest.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.xhtml/src/test/java/org/apache/poi/xwpf/converter/xhtml/XHTMLConverterEmbedImgTest.java
@@ -27,7 +27,7 @@
import fr.opensagres.poi.xwpf.converter.xhtml.Base64EmbedImgManager;
import fr.opensagres.poi.xwpf.converter.xhtml.XHTMLConverter;
import fr.opensagres.poi.xwpf.converter.xhtml.XHTMLOptions;
-import org.apache.poi.openxml4j.util.ZipSecureFile;
+//import org.apache.poi.openxml4j.util.ZipSecureFile;
import org.apache.poi.xwpf.converter.core.AbstractXWPFPOIConverterTest;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
From 776d8ff51ffa18ad1ebb559b01fb7c2fbd96944a Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 14:36:27 +0530
Subject: [PATCH 12/30] Update XHTMLConverterTestCase.java
Changing due to poi version 3.11
---
.../apache/poi/xwpf/converter/xhtml/XHTMLConverterTestCase.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.xhtml/src/test/java/org/apache/poi/xwpf/converter/xhtml/XHTMLConverterTestCase.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.xhtml/src/test/java/org/apache/poi/xwpf/converter/xhtml/XHTMLConverterTestCase.java
index 49519cac1..d73d4b109 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.xhtml/src/test/java/org/apache/poi/xwpf/converter/xhtml/XHTMLConverterTestCase.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.xhtml/src/test/java/org/apache/poi/xwpf/converter/xhtml/XHTMLConverterTestCase.java
@@ -30,7 +30,7 @@
import java.io.OutputStream;
import fr.opensagres.poi.xwpf.converter.core.ImageManager;
-import org.apache.poi.openxml4j.util.ZipSecureFile;
+//import org.apache.poi.openxml4j.util.ZipSecureFile;
import org.apache.poi.xwpf.converter.core.AbstractXWPFPOIConverterTest;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
From 88999aab8f7285345ceea3c52dff4035d9c9fb6d Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:08:12 +0530
Subject: [PATCH 13/30] Update ODTDefaultStylesGenerator.java
---
.../document/odt/textstyling/ODTDefaultStylesGenerator.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/document/fr.opensagres.xdocreport.document.odt/src/main/java/fr/opensagres/xdocreport/document/odt/textstyling/ODTDefaultStylesGenerator.java b/document/fr.opensagres.xdocreport.document.odt/src/main/java/fr/opensagres/xdocreport/document/odt/textstyling/ODTDefaultStylesGenerator.java
index 06ae34f9a..487110ef0 100644
--- a/document/fr.opensagres.xdocreport.document.odt/src/main/java/fr/opensagres/xdocreport/document/odt/textstyling/ODTDefaultStylesGenerator.java
+++ b/document/fr.opensagres.xdocreport.document.odt/src/main/java/fr/opensagres/xdocreport/document/odt/textstyling/ODTDefaultStylesGenerator.java
@@ -449,7 +449,10 @@ public String getTextStyleName( ContainerProperties properties )
startStyleIfNeeded(properties.getType(), properties.getStyleName());
dynamicStyles.append( "style:text-position=\"super\" " );
}
-
+ if (properties.getBackgroundColor() != null){
+ startStyleIfNeeded(properties.getType());
+ dynamicStyles.append( "fo:background-color=\""+ properties.getBackgroundColor()+ "\" ");
+ }
//
setPropertiesKind( ODTStyleProperties.PARAGRAPH );
TextAlignment textAlignment = properties.getTextAlignment();
From e69c8049b489836cdec55ccf9ac9164a24f91169 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:10:47 +0530
Subject: [PATCH 14/30] Update StylesHelper.java
---
.../xdocreport/document/textstyling/html/StylesHelper.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/document/fr.opensagres.xdocreport.document/src/main/java/fr/opensagres/xdocreport/document/textstyling/html/StylesHelper.java b/document/fr.opensagres.xdocreport.document/src/main/java/fr/opensagres/xdocreport/document/textstyling/html/StylesHelper.java
index 7f28399ba..b8644e98b 100644
--- a/document/fr.opensagres.xdocreport.document/src/main/java/fr/opensagres/xdocreport/document/textstyling/html/StylesHelper.java
+++ b/document/fr.opensagres.xdocreport.document/src/main/java/fr/opensagres/xdocreport/document/textstyling/html/StylesHelper.java
@@ -263,6 +263,12 @@ else if ( "inherit".equals( textAlignment ) )
}
}
+
+ String backgroundColor = stylesMap.get("background-color");
+ if(backgroundColor != null) {
+ properties.setBackgroundColor(backgroundColor);
+ }
+
// style
String styleName = stylesMap.get("name");
if (styleName != null) {
From 8b356b94289d682b1f71d87600f0383a4aed0eff Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:14:04 +0530
Subject: [PATCH 15/30] Update ContainerProperties.java
---
.../textstyling/properties/ContainerProperties.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/document/fr.opensagres.xdocreport.document/src/main/java/fr/opensagres/xdocreport/document/textstyling/properties/ContainerProperties.java b/document/fr.opensagres.xdocreport.document/src/main/java/fr/opensagres/xdocreport/document/textstyling/properties/ContainerProperties.java
index 6a3a9d66e..3bdba0a2d 100644
--- a/document/fr.opensagres.xdocreport.document/src/main/java/fr/opensagres/xdocreport/document/textstyling/properties/ContainerProperties.java
+++ b/document/fr.opensagres.xdocreport.document/src/main/java/fr/opensagres/xdocreport/document/textstyling/properties/ContainerProperties.java
@@ -56,6 +56,8 @@ public enum ContainerType
private String styleName;
private final ContainerType type;
+
+ private String backgroundColor;
public ContainerProperties( ContainerType type )
{
@@ -164,5 +166,15 @@ public String getStyleName() {
public void setStyleName(String styleName) {
this.styleName = styleName;
}
+
+
+ public String getBackgroundColor() {
+ return backgroundColor;
+ }
+
+ public void setBackgroundColor(String backgroundColor) {
+ this.backgroundColor = backgroundColor;
+ }
+
}
From 3fad91bbf5d28417af7a052880839a8a96319672 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:17:02 +0530
Subject: [PATCH 16/30] Update ExtendedChapter.java
---
.../xdocreport/itext/extension/ExtendedChapter.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedChapter.java b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedChapter.java
index 30ddab8cb..eea58de63 100644
--- a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedChapter.java
+++ b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedChapter.java
@@ -30,6 +30,7 @@
import com.lowagie.text.Rectangle;
import com.lowagie.text.Section;
import com.lowagie.text.pdf.PdfPCell;
+import java.util.ArrayList;
public class ExtendedChapter
extends Chapter
@@ -68,9 +69,9 @@ public Paragraph getTitle()
if ( computedTitle == null )
{
bookmarkTitleParagraph =
- ExtendedSection.ancestorConstructTitle( getParagraphFactory(), title, numbers, numberDepth, numberStyle );
+ ExtendedSection.ancestorConstructTitle( getParagraphFactory(), title, (ArrayList)numbers, numberDepth, numberStyle );
computedTitle =
- ExtendedSection.constructTitle( getParagraphFactory(), bookmarkTitleParagraph, numbers, numberDepth,
+ ExtendedSection.constructTitle( getParagraphFactory(), bookmarkTitleParagraph, (ArrayList) numbers, numberDepth,
numberStyle, cell );
}
return computedTitle;
From e23855656e686e39003c56308cf19efb62625f81 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:18:26 +0530
Subject: [PATCH 17/30] Update ExtendedChapterAutoNumber.java
---
.../itext/extension/ExtendedChapterAutoNumber.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedChapterAutoNumber.java b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedChapterAutoNumber.java
index b1689cf98..56b24d93f 100644
--- a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedChapterAutoNumber.java
+++ b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedChapterAutoNumber.java
@@ -30,6 +30,7 @@
import com.lowagie.text.Rectangle;
import com.lowagie.text.Section;
import com.lowagie.text.pdf.PdfPCell;
+import java.util.ArrayList;
public class ExtendedChapterAutoNumber
extends ChapterAutoNumber
@@ -57,9 +58,9 @@ public Paragraph getTitle()
if ( computedTitle == null )
{
bookmarkTitleParagraph =
- ExtendedSection.ancestorConstructTitle( getParagraphFactory(), title, numbers, numberDepth, numberStyle );
+ ExtendedSection.ancestorConstructTitle( getParagraphFactory(), title, (ArrayList)numbers, numberDepth, numberStyle );
computedTitle =
- ExtendedSection.constructTitle( getParagraphFactory(), bookmarkTitleParagraph, numbers, numberDepth,
+ ExtendedSection.constructTitle( getParagraphFactory(), bookmarkTitleParagraph,(ArrayList) numbers, numberDepth,
numberStyle, cell );
}
return computedTitle;
From 83b35c31ab4a105a31a32b160f1129345387cd1d Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:19:37 +0530
Subject: [PATCH 18/30] Update ExtendedSection.java
---
.../xdocreport/itext/extension/ExtendedSection.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedSection.java b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedSection.java
index 2be90a586..e98fd6750 100644
--- a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedSection.java
+++ b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/src/main/java/fr/opensagres/xdocreport/itext/extension/ExtendedSection.java
@@ -55,9 +55,9 @@ public Paragraph getTitle()
if ( computedTitle == null )
{
bookmarkTitleParagraph =
- ExtendedSection.ancestorConstructTitle( getParagraphFactory(), title, numbers, numberDepth, numberStyle );
+ ExtendedSection.ancestorConstructTitle( getParagraphFactory(), title, (ArrayList)numbers, numberDepth, numberStyle );
computedTitle =
- ExtendedSection.constructTitle( getParagraphFactory(), bookmarkTitleParagraph, numbers, numberDepth,
+ ExtendedSection.constructTitle( getParagraphFactory(), bookmarkTitleParagraph, (ArrayList)numbers, numberDepth,
numberStyle, cell );
}
return computedTitle;
From b825f972b9646c63cf2ad9a2ebe5de8a04cb44f9 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:21:14 +0530
Subject: [PATCH 19/30] Update PdfMapper.java
---
.../opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
index a39a79354..32fdd9223 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
@@ -708,7 +708,7 @@ private Chunk createTextChunk( String text, boolean pageNumber, Font currentRunF
}
if ( singleUnderlined )
{
- textChunk.setUnderline( 1, -2 );
+ textChunk.setUnderline( 0.1F, -2 );
}
}
From 24df3ddd423457f3d65a439da6cde3d8ad5fa5a9 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:22:34 +0530
Subject: [PATCH 20/30] Update PdfMapper.java
---
.../poi/xwpf/converter/pdf/internal/PdfMapper.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
index 32fdd9223..de6654c1c 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
@@ -820,10 +820,10 @@ protected void visitTabs( CTTabs tabs, IITextContainer pdfParagraphContainer )
paragraph = (Paragraph) ( (StylableAnchor) pdfParagraphContainer ).getITextContainer();
}
currentRunX = paragraph.getFirstLineIndent();
- List chunks = paragraph.getChunks();
- for ( Chunk chunk : chunks )
+ List chunks = (List)paragraph.getChunks();
+ for ( Object chunk : chunks )
{
- currentRunX += chunk.getWidthPoint();
+ currentRunX += ((Chunk)chunk).getWidthPoint();
}
}
else
From 3421b36b4ae57beeab082439c9a8cfe5eb7e8443 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:23:42 +0530
Subject: [PATCH 21/30] Update FastPdfMapper.java
---
.../poi/xwpf/converter/pdf/internal/FastPdfMapper.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/FastPdfMapper.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/FastPdfMapper.java
index 6387405f5..6cee7df33 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/FastPdfMapper.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/FastPdfMapper.java
@@ -476,7 +476,7 @@ private Chunk createTextChunk( String text, boolean pageNumber, Font currentRunF
}
if ( singleUnderlined )
{
- textChunk.setUnderline( 1, -2 );
+ textChunk.setUnderline( 0.1F, -2 );
}
}
From 6d62702dbb203edf6046252695829a6d3c74d77a Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:25:24 +0530
Subject: [PATCH 22/30] Update StylableAnchor.java
---
.../odfdom/converter/pdf/internal/stylable/StylableAnchor.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableAnchor.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableAnchor.java
index 6c21d5f42..eea8e4adc 100755
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableAnchor.java
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableAnchor.java
@@ -90,8 +90,9 @@ public Element getElement()
{
// underline font if not explicitly set
ArrayList chunks = getChunks();
- for ( Chunk chunk : chunks )
+ for ( Object elem : chunks )
{
+ Chunk chunk = (Chunk)elem;
Font f = chunk.getFont();
if ( f != null && !f.isUnderlined() )
{
From cda370e5b55bb2f1ed09e1b6a6e84e501b18f090 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:26:41 +0530
Subject: [PATCH 23/30] Update StylableList.java
---
.../odfdom/converter/pdf/internal/stylable/StylableList.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableList.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableList.java
index 9f8286a6b..d7ee26124 100755
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableList.java
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableList.java
@@ -117,8 +117,9 @@ private void addElement( Element element, boolean addLabel )
if ( symbolFont.isStandardFont() )
{
ArrayList chunks = p.getChunks();
- for ( Chunk chunk : chunks )
+ for ( Object elem : chunks )
{
+ Chunk chunk = (Chunk)elem;
// use first specified font
if ( !chunk.getFont().isStandardFont() )
{
From 7337d94ae795f70de8e9d330fe7a49447ca5075b Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:29:30 +0530
Subject: [PATCH 24/30] Update StylableParagraph.java
---
.../internal/stylable/StylableParagraph.java | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java
index 377ace4f7..7c372f8f3 100755
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java
@@ -222,9 +222,10 @@ private void postProcessEmptyParagraph()
// add space if this paragraph is empty
// otherwise its height will be zero
boolean empty = true;
- ArrayList chunks = getChunks();
- for ( Chunk chunk : chunks )
+ ArrayList chunks = getChunks();
+ for ( Object elem : chunks )
{
+ Chunk chunk = (Chunk)elem;
if ( chunk.getImage() == null && chunk.getContent() != null && chunk.getContent().length() > 0 )
{
empty = false;
@@ -242,10 +243,10 @@ private void postProcessBookmarks()
{
// add space if last chunk is a bookmark
// otherwise the bookmark will disappear from pdf
- ArrayList chunks = getChunks();
+ ArrayList chunks = getChunks();
if ( chunks.size() > 0 )
{
- Chunk lastChunk = chunks.get( chunks.size() - 1 );
+ Chunk lastChunk = (Chunk)chunks.get( chunks.size() - 1 );
String localDestination = null;
if ( lastChunk.getAttributes() != null )
{
@@ -289,9 +290,10 @@ private void postProcessLineHeightAndBaseline()
// again this may be inaccurate if fonts with different size are used in this paragraph
float itextdescender = -font.getBaseFont().getFontDescriptor( BaseFont.DESCENT, size ); // negative
float textRise = itextdescender + getTotalLeading() - font.getSize() * multiplier;
- ArrayList chunks = getChunks();
- for ( Chunk chunk : chunks )
+ ArrayList chunks = getChunks();
+ for ( Object elem : chunks )
{
+ Chunk chunk = (Chunk)elem;
Font f = chunk.getFont();
if ( f != null )
{
@@ -323,9 +325,10 @@ private Font getMostOftenUsedFont()
Map countMap = new LinkedHashMap();
Font mostUsedFont = null;
int mostUsedCount = -1;
- ArrayList chunks = getChunks();
- for ( Chunk chunk : chunks )
+ ArrayList chunks = getChunks();
+ for ( Object elem : chunks )
{
+ Chunk chunk = (Chunk)elem;
Font font = chunk.getFont();
int count = 0;
String text = chunk.getContent();
From c55691e45a753354ce0a97c71a04de0e1f0a05e5 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:30:45 +0530
Subject: [PATCH 25/30] Update StylablePhrase.java
---
.../converter/pdf/internal/stylable/StylablePhrase.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylablePhrase.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylablePhrase.java
index b1c007725..d826d850b 100755
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylablePhrase.java
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylablePhrase.java
@@ -88,9 +88,10 @@ public IStylableContainer getParent()
public Element getElement()
{
boolean empty = true;
- ArrayList chunks = getChunks();
- for ( Chunk chunk : chunks )
+ ArrayList chunks = getChunks();
+ for ( Object elem : chunks )
{
+ Chunk chunk = (Chunk)elem;
if ( chunk.getImage() == null && chunk.getContent() != null && chunk.getContent().length() > 0 )
{
empty = false;
From 0a52fad4876aec9080953c0f3f78c109707b5cf4 Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:31:52 +0530
Subject: [PATCH 26/30] Update StylableAnchor.java
---
.../odfdom/converter/pdf/internal/stylable/StylableAnchor.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableAnchor.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableAnchor.java
index eea8e4adc..59aaa1444 100755
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableAnchor.java
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableAnchor.java
@@ -89,7 +89,7 @@ public IStylableContainer getParent()
public Element getElement()
{
// underline font if not explicitly set
- ArrayList chunks = getChunks();
+ ArrayList chunks = getChunks();
for ( Object elem : chunks )
{
Chunk chunk = (Chunk)elem;
From f0e36a3fcddfb77588dda8e2f1544ba09982156c Mon Sep 17 00:00:00 2001
From: nucleussoftwareopen
<68267737+nucleussoftwareopen@users.noreply.github.com>
Date: Thu, 7 Jan 2021 15:32:52 +0530
Subject: [PATCH 27/30] Update StylableList.java
---
.../odfdom/converter/pdf/internal/stylable/StylableList.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableList.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableList.java
index d7ee26124..842ff9127 100755
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableList.java
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableList.java
@@ -116,7 +116,7 @@ private void addElement( Element element, boolean addLabel )
Font symbolFont = symbol.getFont();
if ( symbolFont.isStandardFont() )
{
- ArrayList chunks = p.getChunks();
+ ArrayList chunks = p.getChunks();
for ( Object elem : chunks )
{
Chunk chunk = (Chunk)elem;
From 6f1774fb32c87eef742f33e7d30bece4ffcf1aca Mon Sep 17 00:00:00 2001
From: Jaspreet Singh1
Date: Wed, 20 Apr 2022 15:34:24 +0530
Subject: [PATCH 28/30] RTL support when using Apache POI with openPdf
---
.../core/styles/XWPFStylesDocument.java | 73 +++++--------------
.../ParagraphRunDirectionProvider.java | 15 ++++
.../table/TableRunDirectionValueProvider.java | 25 +++++++
.../converter/pdf/internal/PdfMapper.java | 63 ++++++++++------
4 files changed, 99 insertions(+), 77 deletions(-)
create mode 100644 thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/paragraph/ParagraphRunDirectionProvider.java
create mode 100644 thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/table/TableRunDirectionValueProvider.java
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/XWPFStylesDocument.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/XWPFStylesDocument.java
index da7e78c2e..24fb9d05c 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/XWPFStylesDocument.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/XWPFStylesDocument.java
@@ -35,6 +35,8 @@
import java.util.List;
import java.util.Map;
+import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.*;
+import fr.opensagres.poi.xwpf.converter.core.styles.table.*;
import org.apache.poi.POIXMLDocumentPart;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.UnderlinePatterns;
@@ -49,34 +51,8 @@
import org.apache.poi.xwpf.usermodel.XWPFTableRow;
import org.apache.xmlbeans.XmlException;
import org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocDefaults;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFont;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTNumPr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSettings;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTString;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTStyle;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTStyles;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTabs;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPrBase;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPrEx;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblStylePr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTextDirection;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTrPr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTwipsMeasure;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.FontsDocument;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.*;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc.Enum;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.SettingsDocument;
import fr.opensagres.poi.xwpf.converter.core.BorderSide;
import fr.opensagres.poi.xwpf.converter.core.Color;
@@ -85,21 +61,6 @@
import fr.opensagres.poi.xwpf.converter.core.TableHeight;
import fr.opensagres.poi.xwpf.converter.core.TableWidth;
import fr.opensagres.poi.xwpf.converter.core.openxmlformats.IOpenXMLFormatsPartProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphAlignmentValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphBackgroundColorValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphBorderBottomValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphBorderLeftValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphBorderRightValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphBorderTopValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphIndentationFirstLineValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphIndentationHangingValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphIndentationLeftValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphIndentationRightValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphLineSpacingValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphNumPrValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphSpacingAfterValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphSpacingBeforeValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.paragraph.ParagraphTabsValueProvider;
import fr.opensagres.poi.xwpf.converter.core.styles.run.RunBackgroundColorValueProvider;
import fr.opensagres.poi.xwpf.converter.core.styles.run.RunFontColorValueProvider;
import fr.opensagres.poi.xwpf.converter.core.styles.run.RunFontFamilyAsciiValueProvider;
@@ -112,19 +73,6 @@
import fr.opensagres.poi.xwpf.converter.core.styles.run.RunTextHighlightingValueProvider;
import fr.opensagres.poi.xwpf.converter.core.styles.run.RunUnderlineValueProvider;
import fr.opensagres.poi.xwpf.converter.core.styles.run.RunVerticalAlignValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableAlignmentValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableBorderBottomValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableBorderInsideHValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableBorderInsideVValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableBorderLeftValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableBorderRightValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableBorderTopValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableIndentationValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableMarginBottomValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableMarginLeftValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableMarginRightValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableMarginTopValueProvider;
-import fr.opensagres.poi.xwpf.converter.core.styles.table.TableWidthValueProvider;
import fr.opensagres.poi.xwpf.converter.core.styles.table.cell.TableCellBackgroundColorValueProvider;
import fr.opensagres.poi.xwpf.converter.core.styles.table.cell.TableCellBorderBottomValueProvider;
import fr.opensagres.poi.xwpf.converter.core.styles.table.cell.TableCellBorderInsideHValueProvider;
@@ -448,6 +396,11 @@ public Color getBackgroundColor( CTPPr pPr )
return ParagraphBackgroundColorValueProvider.INSTANCE.getValue( pPr );
}
+ /*enabling bidirectional support*/
+ public CTOnOff getParagraphRunDirection(XWPFParagraph docxParagraph) {
+ return ParagraphRunDirectionProvider.INSTANCE.getValue( docxParagraph, this );
+ }
+
/**
* @param paragraph
* @return
@@ -791,6 +744,13 @@ public ParagraphAlignment getTableAlignment( XWPFTable table )
return TableAlignmentValueProvider.INSTANCE.getValue( table, this );
}
+ /*enabling bidirectional support*/
+ public CTOnOff getTableRunDirection(XWPFTable table )
+ {
+ return TableRunDirectionValueProvider.INSTANCE.getValue( table, this );
+ }
+
+
public ParagraphAlignment getTableAlignment( CTTblPr tblPr )
{
return TableAlignmentValueProvider.INSTANCE.getValue( tblPr );
@@ -1452,7 +1412,8 @@ private static CTSettings getCTSettings( XWPFDocument document )
return null;
}
- private static abstract class DocumentVisitor {
+
+ private static abstract class DocumentVisitor {
protected abstract boolean acceptRelationshipType(String relationshipType);
protected abstract boolean visitDocumentPart(String relationshipType, POIXMLDocumentPart p);
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/paragraph/ParagraphRunDirectionProvider.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/paragraph/ParagraphRunDirectionProvider.java
new file mode 100644
index 000000000..84bf761c1
--- /dev/null
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/paragraph/ParagraphRunDirectionProvider.java
@@ -0,0 +1,15 @@
+package fr.opensagres.poi.xwpf.converter.core.styles.paragraph;
+
+
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr;
+/*enabling bidirectional support -> paragraph direction*/
+public class ParagraphRunDirectionProvider extends AbstractParagraphValueProvider{
+
+ public static final ParagraphRunDirectionProvider INSTANCE = new ParagraphRunDirectionProvider();
+
+ @Override
+ public CTOnOff getValue(CTPPr ppr) {
+ return ppr == null || !ppr.isSetBidi() ? null : ppr.getBidi();
+ }
+}
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/table/TableRunDirectionValueProvider.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/table/TableRunDirectionValueProvider.java
new file mode 100644
index 000000000..039244054
--- /dev/null
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.core/src/main/java/fr/opensagres/poi/xwpf/converter/core/styles/table/TableRunDirectionValueProvider.java
@@ -0,0 +1,25 @@
+package fr.opensagres.poi.xwpf.converter.core.styles.table;
+
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTOnOff;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPr;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTblPrBase;
+
+/*enabling bidirectional support -> table run direction*/
+public class TableRunDirectionValueProvider extends AbstractTableValueProvider {
+
+ public static final TableRunDirectionValueProvider INSTANCE = new TableRunDirectionValueProvider();
+
+ @Override
+ public CTOnOff getValue(CTTblPr tblPr) {
+ return getTableRunDirection(tblPr);
+ }
+
+ @Override
+ public CTOnOff getValue(CTTblPrBase tblPr) {
+ return getTableRunDirection(tblPr);
+ }
+
+ private CTOnOff getTableRunDirection(CTTblPrBase tblPr){
+ return tblPr == null || !tblPr.isSetBidiVisual() ? null : tblPr.getBidiVisual();
+ }
+}
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
index de6654c1c..a3a8837dd 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
@@ -33,9 +33,11 @@
import java.util.Map;
import java.util.logging.Logger;
+import com.lowagie.text.pdf.PdfWriter;
import com.microsoft.schemas.vml.CTImageData;
import com.microsoft.schemas.vml.CTShape;
import fr.opensagres.poi.xwpf.converter.core.*;
+import fr.opensagres.poi.xwpf.converter.core.utils.XWPFUtils;
import org.apache.poi.xwpf.usermodel.IBodyElement;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.UnderlinePatterns;
@@ -57,23 +59,7 @@
import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.STRelFromH;
import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.STRelFromV;
import org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.STWrapText;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBookmark;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBorder;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTLvl;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPTab;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTabStop;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTabs;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTextDirection;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTabJc;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTabTlc;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STTextDirection;
-import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc;
+import org.openxmlformats.schemas.wordprocessingml.x2006.main.*;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STVerticalJc.Enum;
import com.lowagie.text.Chunk;
@@ -322,13 +308,24 @@ protected IITextContainer startVisitParagraph( XWPFParagraph docxParagraph, List
}
+ /*enabling bidirectional support-> paragraph direction*/
+ CTOnOff bidi = stylesDocument.getParagraphRunDirection(docxParagraph);
+ if(isRTLLayoutSet(bidi)){
+ pdfParagraph.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
+ }else{
+ pdfParagraph.setRunDirection(PdfWriter.RUN_DIRECTION_LTR);
+ }
// text-align
ParagraphAlignment alignment = stylesDocument.getParagraphAlignment( docxParagraph );
if ( alignment != null )
{
switch ( alignment )
{
+ /* please refer -> https://docs.microsoft.com/en-us/globalization/input/text-justification*/
case LEFT:
+ case LOW_KASHIDA:
+ case MEDIUM_KASHIDA:
+ case HIGH_KASHIDA:
pdfParagraph.setAlignment( Element.ALIGN_LEFT );
break;
case RIGHT:
@@ -343,6 +340,9 @@ protected IITextContainer startVisitParagraph( XWPFParagraph docxParagraph, List
default:
break;
}
+ }else{
+ //enabling bidirectional support -> if by default Alignment of Paragraph is Undefined, set it to left
+ pdfParagraph.setAlignment( Element.ALIGN_LEFT );
}
// background-color
@@ -438,6 +438,10 @@ protected IITextContainer startVisitParagraph( XWPFParagraph docxParagraph, List
return pdfParagraph;
}
+ private boolean isRTLLayoutSet(CTOnOff bidiProperty){
+ return XWPFUtils.isCTOnOff(bidiProperty);
+ }
+
@Override
protected void endVisitParagraph( XWPFParagraph docxParagraph, IITextContainer pdfParentContainer,
IITextContainer pdfParagraphContainer )
@@ -1078,6 +1082,7 @@ private StylableTable createPDFTable( XWPFTable table, float[] colWidths, IIText
throws DocumentException
{
// 2) Compute tableWith
+ boolean isRightToLeftTable = false;
TableWidth tableWidth = stylesDocument.getTableWidth( table );
StylableTable pdfPTable = pdfDocument.createTable( pdfParentContainer, colWidths.length );
pdfPTable.setTotalWidth( colWidths );
@@ -1094,6 +1099,13 @@ private StylableTable createPDFTable( XWPFTable table, float[] colWidths, IIText
}
pdfPTable.setLockedWidth( true );
+ //enabling bidirectional support -> Table layout/run direction(based on layout)
+ CTOnOff bidiVisual = stylesDocument.getTableRunDirection(table);
+ if(isRTLLayoutSet(bidiVisual)){
+ isRightToLeftTable = true;
+ pdfPTable.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
+ }
+
// Table alignment
ParagraphAlignment alignment = stylesDocument.getTableAlignment( table );
if ( alignment != null )
@@ -1115,13 +1127,22 @@ private StylableTable createPDFTable( XWPFTable table, float[] colWidths, IIText
default:
break;
}
+ }else{
+ if(isRightToLeftTable){
+ pdfPTable.setHorizontalAlignment(Element.ALIGN_RIGHT);
+ }else{
+ pdfPTable.setHorizontalAlignment(Element.ALIGN_LEFT);
+ }
}
// Table indentation
Float indentation = stylesDocument.getTableIndentation( table );
- if ( indentation != null )
- {
- pdfPTable.setPaddingLeft( indentation );
+ if ( indentation != null ) {
+ if (isRightToLeftTable) {
+ pdfPTable.setPaddingRight(indentation);
+ } else {
+ pdfPTable.setPaddingLeft(indentation);
+ }
}
return pdfPTable;
}
@@ -1130,7 +1151,7 @@ private StylableTable createPDFTable( XWPFTable table, float[] colWidths, IIText
protected void endVisitTable( XWPFTable table, IITextContainer pdfParentContainer,
IITextContainer pdfTableContainer )
throws Exception
- {
+ { //StylableDocument --> PdfPtable
pdfParentContainer.addElement( ( (ExtendedPdfPTable) pdfTableContainer ).getElement() );
}
From 4221639f9e9179b9bc45bc0d912520f9fa6ea8de Mon Sep 17 00:00:00 2001
From: Shivam Tyagi1
Date: Wed, 29 Jun 2022 18:11:03 +0530
Subject: [PATCH 29/30] Adding RTL support for ODT document conversion to PDF.
---
.../pdf/internal/StyleEngineForIText.java | 12 ++++++++++++
.../pdf/internal/stylable/StylableParagraph.java | 14 ++++++++++++++
.../pdf/internal/stylable/StylableTable.java | 11 ++++++++++-
.../internal/styles/StyleParagraphProperties.java | 15 +++++++++++++++
.../pdf/internal/styles/StyleTableProperties.java | 14 ++++++++++++++
5 files changed, 65 insertions(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/StyleEngineForIText.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/StyleEngineForIText.java
index f0421aab3..6c5ecd562 100755
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/StyleEngineForIText.java
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/StyleEngineForIText.java
@@ -737,6 +737,12 @@ else if ( FoBreakBeforeAttribute.Value.COLUMN.toString().equals( breakBefore ) )
paragraphProperties.setBreakBefore( StyleBreak.createWithNoBreak() );
}
}
+
+ // writing-mode
+ String writingMode = ele.getStyleWritingModeAttribute();
+ if ( StringUtils.isNotEmpty( writingMode ) ){
+ paragraphProperties.setWritingMode( writingMode );
+ }
super.visit( ele );
}
@@ -1134,6 +1140,12 @@ else if ( TableAlignAttribute.Value.RIGHT.toString().equals( align ) )
tableProperties.setMayBreakBetweenRows( mayBreakBetweenRows );
}
+ // writing-mode
+ String writingMode = ele.getStyleWritingModeAttribute();
+ if ( StringUtils.isNotEmpty( writingMode ) ){
+ tableProperties.setWritingMode( writingMode );
+ }
+
super.visit( ele );
}
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java
index 7c372f8f3..484bc67fa 100755
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableParagraph.java
@@ -34,6 +34,7 @@
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.BaseFont;
+import com.lowagie.text.pdf.PdfWriter;
import fr.opensagres.odfdom.converter.core.utils.ODFUtils;
import fr.opensagres.odfdom.converter.pdf.internal.styles.Style;
import fr.opensagres.odfdom.converter.pdf.internal.styles.StyleBreak;
@@ -147,6 +148,19 @@ public void applyStyles( Style style )
{
super.setKeepTogether( keepTogether );
}
+
+ // Support for writing mode i.e. LTR OR RTL
+ String writingMode = paragraphProperties.getWritingMode();
+ if ( writingMode != null && writingMode.equals("rl-tb"))
+ {
+ // RTL
+ super.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
+ }
+ else{
+ // LTR
+ super.setRunDirection(PdfWriter.RUN_DIRECTION_LTR);
+ }
+
}
}
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableTable.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableTable.java
index c555a0c13..d1facb61c 100755
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableTable.java
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableTable.java
@@ -26,6 +26,7 @@
import com.lowagie.text.Element;
+import com.lowagie.text.pdf.PdfWriter;
import fr.opensagres.odfdom.converter.pdf.internal.styles.Style;
import fr.opensagres.odfdom.converter.pdf.internal.styles.StyleTableProperties;
import fr.opensagres.odfdom.converter.pdf.internal.styles.StyleTableRowProperties;
@@ -131,7 +132,7 @@ public void applyStyles( Style style )
// alignment
int alignment = tableProperties.getAlignment();
- if ( alignment != Element.ALIGN_UNDEFINED )
+ if (alignment != Element.ALIGN_UNDEFINED && style.getFamilyName().equals("table"))
{
super.setHorizontalAlignment( alignment );
}
@@ -169,6 +170,14 @@ public void applyStyles( Style style )
{
super.setKeepTogether( !mayBreakBetweenRows );
}
+
+ // Support for writing mode i.e. LTR OR RTL
+ String writingMode = tableProperties.getWritingMode();
+ if ( writingMode != null && writingMode.equals("rl-tb"))
+ {
+ // RTL
+ super.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
+ }
}
StyleTableRowProperties tableRowProperties = style.getTableRowProperties();
if ( tableRowProperties != null )
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/styles/StyleParagraphProperties.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/styles/StyleParagraphProperties.java
index ecaed6574..89c785328 100755
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/styles/StyleParagraphProperties.java
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/styles/StyleParagraphProperties.java
@@ -78,6 +78,8 @@ public class StyleParagraphProperties
private Float paddingTop;
private Float textIndent;
+
+ private String writingMode;
public StyleParagraphProperties()
{
@@ -185,6 +187,9 @@ public void merge( StyleParagraphProperties paragraphProperties )
{
textIndent = paragraphProperties.getTextIndent();
}
+ if(paragraphProperties.getWritingMode() != null){
+ writingMode = paragraphProperties.getWritingMode();
+ }
}
public int getAlignment()
@@ -416,4 +421,14 @@ public void setTextIndent( Float textIndent )
{
this.textIndent = textIndent;
}
+
+ public String getWritingMode()
+ {
+ return writingMode;
+ }
+
+ public void setWritingMode( String writingMode )
+ {
+ this.writingMode = writingMode;
+ }
}
diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/styles/StyleTableProperties.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/styles/StyleTableProperties.java
index d4fdd0c10..8c656d113 100755
--- a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/styles/StyleTableProperties.java
+++ b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/styles/StyleTableProperties.java
@@ -48,6 +48,8 @@ public class StyleTableProperties
private Float width;
+ private String writingMode;
+
public StyleTableProperties()
{
}
@@ -98,6 +100,10 @@ public void merge( StyleTableProperties tableProperties )
{
width = tableProperties.getWidth();
}
+ if ( tableProperties.getWritingMode() != null )
+ {
+ writingMode = tableProperties.getWritingMode();
+ }
}
public int getAlignment()
@@ -189,4 +195,12 @@ public void setWidth( Float width )
{
this.width = width;
}
+
+ public String getWritingMode() {
+ return writingMode;
+ }
+
+ public void setWritingMode(String writingMode) {
+ this.writingMode = writingMode;
+ }
}
From ac792020d1c1076f018c3ec12fb53c9877f13e28 Mon Sep 17 00:00:00 2001
From: Jaspreet Singh1
Date: Thu, 21 Jul 2022 15:07:00 +0530
Subject: [PATCH 30/30] Empty char should not be replaced with space as it
causes multiple extra spaces issues.
---
.../opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
index a3a8837dd..6fcdc186b 100644
--- a/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
+++ b/thirdparties-extension/fr.opensagres.poi.xwpf.converter.pdf/src/main/java/fr/opensagres/poi/xwpf/converter/pdf/internal/PdfMapper.java
@@ -769,7 +769,7 @@ private void createAndAddChunks( IITextContainer parent, String textContent, Und
}
// end chunk
Font chunkFont = getFont( font, fontAsian, fontComplex, currentGroup );
- Chunk chunk = createTextChunk( textContent.isEmpty() ? " " : sbuf.toString(), pageNumber, chunkFont,
+ Chunk chunk = createTextChunk( sbuf.toString(), pageNumber, chunkFont,
underlinePatterns, backgroundColor );
parent.addElement( chunk );
}