-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
80 additions
and
39 deletions.
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
23 changes: 23 additions & 0 deletions
23
src/main/java/org/fugerit/java/doc/mod/openpdf/helpers/OpenPDFConfigHelper.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,23 @@ | ||
package org.fugerit.java.doc.mod.openpdf.helpers; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.fugerit.java.core.cfg.ConfigException; | ||
import org.w3c.dom.Element; | ||
import org.w3c.dom.NodeList; | ||
|
||
@Slf4j | ||
public class OpenPDFConfigHelper { | ||
|
||
public static void handleConfig( Element config, String type ) throws ConfigException { | ||
log.info( "configure for type: {}", type ); | ||
NodeList fontList = config.getElementsByTagName( "font" ); | ||
for ( int k=0; k<fontList.getLength(); k++ ) { | ||
Element currentFontTag = (Element) fontList.item( k ); | ||
String name = currentFontTag.getAttribute( "name" ); | ||
String path = currentFontTag.getAttribute( "path" ); | ||
log.info( "current font {} - {}", name, path ); | ||
ConfigException.apply( () -> OpenPpfDocHandler.registerFont( name , path ) ); | ||
} | ||
} | ||
|
||
} |
31 changes: 0 additions & 31 deletions
31
src/test/java/test/org/fugerit/java/doc/mod/itext/poc/TestSpec.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...erit/java/doc/mod/itext/poc/PocIndex.java → ...it/java/doc/mod/openpdf/poc/PocIndex.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
2 changes: 1 addition & 1 deletion
2
...ava/doc/mod/itext/poc/TestDefaultDoc.java → ...a/doc/mod/openpdf/poc/TestDefaultDoc.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
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
2 changes: 1 addition & 1 deletion
2
.../doc/mod/itext/poc/TestOpenPdfHelper.java → ...oc/mod/openpdf/poc/TestOpenPdfHelper.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
2 changes: 1 addition & 1 deletion
2
...java/doc/mod/itext/poc/TestPdfHelper.java → ...va/doc/mod/openpdf/poc/TestPdfHelper.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
2 changes: 1 addition & 1 deletion
2
...a/doc/mod/itext/poc/TestPhraseParent.java → ...doc/mod/openpdf/poc/TestPhraseParent.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
17 changes: 17 additions & 0 deletions
17
src/test/java/test/org/fugerit/java/doc/mod/openpdf/poc/TestSpec.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,17 @@ | ||
package test.org.fugerit.java.doc.mod.openpdf.poc; | ||
|
||
import org.fugerit.java.doc.mod.openpdf.PdfTypeHandler; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class TestSpec extends TestDocBase { | ||
|
||
private static final String DEFAULT_DOC = "test"; | ||
|
||
@Test | ||
public void testOpenPDF() { | ||
boolean ok = this.testDocWorker( DEFAULT_DOC , PdfTypeHandler.HANDLER ); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<freemarker-doc-process-config | ||
xmlns="https://freemarkerdocprocess.fugerit.org" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://freemarkerdocprocess.fugerit.org https://www.fugerit.org/data/java/doc/xsd/freemarker-doc-process-1-0.xsd" > | ||
|
||
<docHandlerConfig registerById="true"> | ||
<docHandler id="pdf_openpdf" info="pdf" type="org.fugerit.java.doc.mod.openpdf.PdfTypeHandler"> | ||
<docHandlerCustomConfig charset="UTF-8"> | ||
<font name="Calibri" path="src/test/resources/font/TitilliumWeb-Regular.ttf"/> | ||
</docHandlerCustomConfig> | ||
</docHandler> | ||
<docHandler id="rtf_openpdf" info="rtf" type="org.fugerit.java.doc.mod.openpdf.RtfTypeHandler"> | ||
</docHandler> | ||
<docHandler id="html_openpdf" info="html" type="org.fugerit.java.doc.mod.openpdf.HtmlTypeHandler"> | ||
</docHandler> | ||
</docHandlerConfig> | ||
|
||
</freemarker-doc-process-config> |