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(); 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) { 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; + } + } diff --git a/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/pom.xml b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/pom.xml index e08898d15..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 @@ -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 + 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/StylableAnchor.java b/thirdparties-extension/fr.opensagres.odfdom.converter.pdf/src/main/java/fr/opensagres/odfdom/converter/pdf/internal/stylable/StylableAnchor.java index 6c21d5f42..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,9 +89,10 @@ public IStylableContainer getParent() public Element getElement() { // underline font if not explicitly set - 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 && !f.isUnderlined() ) { 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..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,9 +116,10 @@ private void addElement( Element element, boolean addLabel ) Font symbolFont = symbol.getFont(); if ( symbolFont.isStandardFont() ) { - ArrayList chunks = p.getChunks(); - for ( Chunk chunk : chunks ) + ArrayList chunks = p.getChunks(); + for ( Object elem : chunks ) { + Chunk chunk = (Chunk)elem; // use first specified font if ( !chunk.getFont().isStandardFont() ) { 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..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); + } + } } @@ -222,9 +236,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 +257,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 +304,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 +339,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(); 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; 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; + } } 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 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..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,7 +35,9 @@ import java.util.List; import java.util.Map; -import org.apache.poi.ooxml.POIXMLDocumentPart; +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; import org.apache.poi.xwpf.usermodel.VerticalAlign; @@ -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/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 + 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 ); } } 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..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 @@ -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 ) @@ -708,7 +712,7 @@ private Chunk createTextChunk( String text, boolean pageNumber, Font currentRunF } if ( singleUnderlined ) { - textChunk.setUnderline( 1, -2 ); + textChunk.setUnderline( 0.1F, -2 ); } } @@ -765,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 ); } @@ -820,10 +824,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 @@ -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() ); } @@ -1265,7 +1286,7 @@ protected IITextContainer startVisitTableCell( final XWPFTableCell cell, IITextC marginBottom = stylesDocument.getTableMarginBottom( table ); } } - if ( marginBottom != null ) + if ( marginBottom != null && marginBottom > 0) { pdfPCell.setPaddingBottom( marginBottom ); } 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 ) 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; 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; 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; diff --git a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml index 33d133f17..53fd02019 100644 --- a/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml +++ b/thirdparties-extension/fr.opensagres.xdocreport.itext.extension/pom.xml @@ -3,14 +3,14 @@ fr.opensagres.xdocreport thirdparties-extension - 2.0.2 + 2.0.2.1 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 + 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; 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; 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;