-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mod-fop] supporto for table cell back-color attribute
- Loading branch information
Showing
5 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
fj-doc-mod-fop/src/test/java/test/org/fugerit/java/doc/mod/fop/TestAlt.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package test.org.fugerit.java.doc.mod.fop; | ||
|
||
import java.io.FileOutputStream; | ||
import java.io.InputStreamReader; | ||
|
||
import org.fugerit.java.core.function.SafeFunction; | ||
import org.fugerit.java.core.lang.helpers.ClassHelper; | ||
import org.fugerit.java.doc.base.config.DocInput; | ||
import org.fugerit.java.doc.base.config.DocOutput; | ||
import org.fugerit.java.doc.base.config.DocTypeHandler; | ||
import org.fugerit.java.doc.mod.fop.FreeMarkerFopTypeHandlerUTF8; | ||
import org.fugerit.java.doc.mod.fop.InitFopHandler; | ||
import org.fugerit.java.doc.mod.fop.PdfFopTypeHandler; | ||
import org.junit.Assert; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import test.org.fugerit.java.BasicTest; | ||
|
||
@Slf4j | ||
public class TestAlt extends BasicTest { | ||
|
||
@BeforeClass | ||
public static void init() { | ||
SafeFunction.apply( () -> InitFopHandler.initDoc() ); | ||
} | ||
|
||
private boolean testHelper( DocTypeHandler handler ) { | ||
boolean ok = false; | ||
try ( InputStreamReader reader = new InputStreamReader( ClassHelper.loadFromDefaultClassLoader( "sample/doc_alt_01.xml" ) ); | ||
FileOutputStream fos = new FileOutputStream( "target/test_alt_01."+handler.getType() ) ) { | ||
handler.handle( DocInput.newInput( handler.getType(), reader ) , DocOutput.newOutput( fos ) ); | ||
ok = true; | ||
log.info( "result {}", ok ); | ||
} catch (Exception e) { | ||
this.failEx( e ); | ||
} | ||
return ok; | ||
} | ||
|
||
private static final DocTypeHandler[] HANDLERS = { PdfFopTypeHandler.HANDLER, new FreeMarkerFopTypeHandlerUTF8() }; | ||
|
||
@Test | ||
public void testAlt001Ok() { | ||
for ( int k=0; k<HANDLERS.length; k++ ) { | ||
boolean ok = this.testHelper(HANDLERS[k]); | ||
Assert.assertTrue(ok); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<doc xmlns="http://javacoredoc.fugerit.org" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://javacoredoc.fugerit.org https://www.fugerit.org/data/java/doc/xsd/doc-1-10.xsd"> | ||
<metadata> | ||
<info name="margins">10;10;10;30</info> | ||
<info name="excel-table-id">excel-table=print</info> | ||
<info name="excel-width-multiplier">450</info> | ||
<footer-ext> | ||
<para align="center">Page ${currentPage}</para> | ||
</footer-ext> | ||
</metadata> | ||
<body> | ||
<table columns="3" colwidths="30;30;40" id="excel-table" padding="2" width="100"> | ||
<row> | ||
<cell align="center" back-color="#99aaee"> | ||
<para>Name</para> | ||
</cell> | ||
<cell align="center" back-color="#99aaee"> | ||
<para>Surname</para> | ||
</cell> | ||
<cell align="center" back-color="#99aaee"> | ||
<para>Title</para> | ||
</cell> | ||
</row> | ||
<row> | ||
<cell> | ||
<para>Luthien</para> | ||
</cell> | ||
<cell> | ||
<para>Tinuviel</para> | ||
</cell> | ||
<cell> | ||
<para>Queen</para> | ||
</cell> | ||
</row> | ||
<row> | ||
<cell> | ||
<para>Thorin</para> | ||
</cell> | ||
<cell> | ||
<para>Oakshield</para> | ||
</cell> | ||
<cell> | ||
<para>King</para> | ||
</cell> | ||
</row> | ||
</table> | ||
</body> | ||
</doc> |