remove SVG parser, remove log4j remnants
This commit is contained in:
parent
159fee4967
commit
21030c24f0
17 changed files with 46 additions and 101 deletions
|
@ -9,10 +9,8 @@ jna.version = 5.10.0
|
||||||
zxing.version = 3.4.1
|
zxing.version = 3.4.1
|
||||||
reflections.version = 0.9.11
|
reflections.version = 0.9.11
|
||||||
jfreechart.version = 1.5.2
|
jfreechart.version = 1.5.2
|
||||||
echosvg.version = 0.1.2
|
|
||||||
junit.version = 5.8.1
|
junit.version = 5.8.1
|
||||||
junit4.version = 4.13.2
|
junit4.version = 4.13.2
|
||||||
cglib.version = 3.3.0
|
cglib.version = 3.3.0
|
||||||
objenesis.version = 2.6
|
objenesis.version = 2.6
|
||||||
log4j.version = 2.15.0
|
|
||||||
xbib-content.version = 4.0.0
|
xbib-content.version = 4.0.0
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
apply plugin: 'groovy'
|
apply plugin: 'groovy'
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "org.codehaus.groovy:groovy:${project.property('groovy.version')}:indy"
|
implementation "org.codehaus.groovy:groovy:${project.property('groovy.version')}"
|
||||||
}
|
}
|
||||||
|
|
||||||
compileGroovy {
|
compileGroovy {
|
||||||
|
@ -19,16 +19,9 @@ tasks.withType(GroovyCompile) {
|
||||||
if (!options.compilerArgs.contains("-processor")) {
|
if (!options.compilerArgs.contains("-processor")) {
|
||||||
options.compilerArgs << '-proc:none'
|
options.compilerArgs << '-proc:none'
|
||||||
}
|
}
|
||||||
groovyOptions.optimizationOptions.indy = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task groovydocJar(type: Jar, dependsOn: 'groovydoc') {
|
task groovydocJar(type: Jar, dependsOn: 'groovydoc') {
|
||||||
from groovydoc.destinationDir
|
from groovydoc.destinationDir
|
||||||
archiveClassifier.set('javadoc')
|
archiveClassifier.set('javadoc')
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations.all {
|
|
||||||
resolutionStrategy {
|
|
||||||
force "org.codehaus.groovy:groovy:${project.property('groovy.version')}:indy"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,52 +1,20 @@
|
||||||
|
|
||||||
apply from: rootProject.file('gradle/compile/groovy.gradle')
|
apply from: rootProject.file('gradle/compile/groovy.gradle')
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':graphics-pdfbox')
|
api project(':graphics-pdfbox')
|
||||||
api project(':graphics-barcode')
|
api project(':graphics-barcode')
|
||||||
api("org.codehaus.groovy:groovy-xml:${project.property('groovy.version')}:indy") {
|
api("org.codehaus.groovy:groovy-xml:${project.property('groovy.version')}")
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy'
|
|
||||||
}
|
|
||||||
// in groovyland, we need log4j-core for @Log4j2 annotations
|
|
||||||
implementation "org.apache.logging.log4j:log4j-core:${project.property('log4j.version')}"
|
|
||||||
|
|
||||||
// spock need junit vintage
|
// spock need junit vintage
|
||||||
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:${project.property('junit.version')}"
|
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:${project.property('junit.version')}"
|
||||||
|
testImplementation("org.codehaus.groovy:groovy:${project.property('groovy.version')}")
|
||||||
testImplementation("org.codehaus.groovy:groovy:${project.property('groovy.version')}:indy") {
|
testImplementation("org.codehaus.groovy:groovy-json:${project.property('groovy.version')}")
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy'
|
testImplementation("org.codehaus.groovy:groovy-nio:${project.property('groovy.version')}")
|
||||||
}
|
testImplementation("org.codehaus.groovy:groovy-sql:${project.property('groovy.version')}")
|
||||||
testImplementation("org.codehaus.groovy:groovy-json:${project.property('groovy.version')}:indy") {
|
testImplementation("org.codehaus.groovy:groovy-xml:${project.property('groovy.version')}")
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy'
|
testImplementation("org.codehaus.groovy:groovy-macro:${project.property('groovy.version')}")
|
||||||
}
|
testImplementation("org.codehaus.groovy:groovy-templates:${project.property('groovy.version')}")
|
||||||
testImplementation("org.codehaus.groovy:groovy-nio:${project.property('groovy.version')}:indy"){
|
testImplementation("org.codehaus.groovy:groovy-test:${project.property('groovy.version')}")
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy'
|
testImplementation("org.spockframework:spock-core:${project.property('spock.version')}")
|
||||||
}
|
|
||||||
testImplementation("org.codehaus.groovy:groovy-sql:${project.property('groovy.version')}:indy") {
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy'
|
|
||||||
}
|
|
||||||
testImplementation("org.codehaus.groovy:groovy-xml:${project.property('groovy.version')}:indy") {
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy'
|
|
||||||
}
|
|
||||||
testImplementation("org.codehaus.groovy:groovy-macro:${project.property('groovy.version')}:indy") {
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy'
|
|
||||||
}
|
|
||||||
testImplementation("org.codehaus.groovy:groovy-templates:${project.property('groovy.version')}:indy") {
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy'
|
|
||||||
}
|
|
||||||
testImplementation("org.codehaus.groovy:groovy-test:${project.property('groovy.version')}:indy") {
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy'
|
|
||||||
}
|
|
||||||
testImplementation("org.spockframework:spock-core:${project.property('spock.version')}") {
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy'
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy-json'
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy-macro'
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy-nio'
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy-sql'
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy-templates'
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy-test'
|
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy-xml'
|
|
||||||
}
|
|
||||||
testImplementation "cglib:cglib-nodep:${project.property('cglib.version')}" // for spock mock
|
testImplementation "cglib:cglib-nodep:${project.property('cglib.version')}" // for spock mock
|
||||||
testImplementation "org.objenesis:objenesis:${project.property('objenesis.version')}" // for spock mock
|
testImplementation "org.objenesis:objenesis:${project.property('objenesis.version')}" // for spock mock
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package org.xbib.graphics.pdfbox.groovy.analyze
|
package org.xbib.graphics.pdfbox.groovy.analyze
|
||||||
|
|
||||||
import groovy.util.logging.Log4j2
|
import groovy.util.logging.Log
|
||||||
import org.apache.logging.log4j.Level
|
|
||||||
import org.apache.pdfbox.contentstream.PDFGraphicsStreamEngine
|
import org.apache.pdfbox.contentstream.PDFGraphicsStreamEngine
|
||||||
import org.apache.pdfbox.cos.COSName
|
import org.apache.pdfbox.cos.COSName
|
||||||
import org.apache.pdfbox.cos.COSStream
|
import org.apache.pdfbox.cos.COSStream
|
||||||
|
@ -13,8 +12,9 @@ import org.apache.pdfbox.pdmodel.graphics.image.PDImage
|
||||||
import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject
|
import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject
|
||||||
|
|
||||||
import java.awt.geom.Point2D
|
import java.awt.geom.Point2D
|
||||||
|
import java.util.logging.Level
|
||||||
|
|
||||||
@Log4j2
|
@Log
|
||||||
class DocumentAnalyzer {
|
class DocumentAnalyzer {
|
||||||
|
|
||||||
private final Map result = [:]
|
private final Map result = [:]
|
||||||
|
@ -47,7 +47,7 @@ class DocumentAnalyzer {
|
||||||
* at org.apache.pdfbox.cos.COSDictionary.getDate(COSDictionary.java:790) ~[pdfbox-2.0.12.jar:2.0.12]
|
* at org.apache.pdfbox.cos.COSDictionary.getDate(COSDictionary.java:790) ~[pdfbox-2.0.12.jar:2.0.12]
|
||||||
* at org.apache.pdfbox.pdmodel.PDDocumentInformation.getCreationDate(PDDocumentInformation.java:212) ~[pdfbox-2.0.12.jar:2.0.12]
|
* at org.apache.pdfbox.pdmodel.PDDocumentInformation.getCreationDate(PDDocumentInformation.java:212) ~[pdfbox-2.0.12.jar:2.0.12]
|
||||||
*/
|
*/
|
||||||
log.log(Level.WARN, e.getMessage() as String, e)
|
log.log(Level.SEVERE, e.getMessage() as String, e)
|
||||||
}
|
}
|
||||||
result."pages" = []
|
result."pages" = []
|
||||||
document.withCloseable {
|
document.withCloseable {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package org.xbib.graphics.pdfbox.groovy.builder
|
package org.xbib.graphics.pdfbox.groovy.builder
|
||||||
|
|
||||||
import groovy.transform.InheritConstructors
|
import groovy.transform.InheritConstructors
|
||||||
import groovy.util.logging.Log4j2
|
import groovy.util.logging.Log
|
||||||
import groovy.xml.MarkupBuilder
|
import groovy.xml.MarkupBuilder
|
||||||
import org.apache.pdfbox.pdmodel.common.PDMetadata
|
import org.apache.pdfbox.pdmodel.common.PDMetadata
|
||||||
import org.xbib.graphics.pdfbox.groovy.Barcode
|
import org.xbib.graphics.pdfbox.groovy.Barcode
|
||||||
|
@ -17,7 +17,7 @@ import org.xbib.graphics.pdfbox.groovy.TextBlock
|
||||||
import org.xbib.graphics.pdfbox.groovy.render.ParagraphRenderer
|
import org.xbib.graphics.pdfbox.groovy.render.ParagraphRenderer
|
||||||
import org.xbib.graphics.pdfbox.groovy.render.TableRenderer
|
import org.xbib.graphics.pdfbox.groovy.render.TableRenderer
|
||||||
|
|
||||||
@Log4j2
|
@Log
|
||||||
@InheritConstructors
|
@InheritConstructors
|
||||||
class PdfDocumentBuilder extends DocumentBuilder {
|
class PdfDocumentBuilder extends DocumentBuilder {
|
||||||
|
|
||||||
|
@ -38,13 +38,13 @@ class PdfDocumentBuilder extends DocumentBuilder {
|
||||||
inputStream.withCloseable {
|
inputStream.withCloseable {
|
||||||
boolean loaded = PdfFont.addFont(pdfDocument.pdDocument, fd.name, inputStream, fd.bold, fd.italic)
|
boolean loaded = PdfFont.addFont(pdfDocument.pdDocument, fd.name, inputStream, fd.bold, fd.italic)
|
||||||
if (!loaded) {
|
if (!loaded) {
|
||||||
log.warn("font ${fd.name} not loaded")
|
log.warning("font ${fd.name} not loaded")
|
||||||
} else {
|
} else {
|
||||||
log.info("font ${fd.name} added")
|
log.info("font ${fd.name} added")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warn("font ${fd.name} not found in class path")
|
log.warning("font ${fd.name} not found in class path")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
package org.xbib.graphics.pdfbox.groovy.render
|
package org.xbib.graphics.pdfbox.groovy.render
|
||||||
|
|
||||||
import groovy.util.logging.Log4j2
|
|
||||||
import org.xbib.graphics.pdfbox.groovy.TextBlock
|
import org.xbib.graphics.pdfbox.groovy.TextBlock
|
||||||
import org.xbib.graphics.pdfbox.groovy.render.element.ImageElement
|
import org.xbib.graphics.pdfbox.groovy.render.element.ImageElement
|
||||||
import org.xbib.graphics.pdfbox.groovy.render.element.TextElement
|
import org.xbib.graphics.pdfbox.groovy.render.element.TextElement
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
class ParagraphLine {
|
class ParagraphLine {
|
||||||
|
|
||||||
final BigDecimal maxWidth
|
final BigDecimal maxWidth
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.xbib.graphics.pdfbox.groovy.render
|
package org.xbib.graphics.pdfbox.groovy.render
|
||||||
|
|
||||||
import groovy.util.logging.Log4j2
|
|
||||||
import org.apache.pdfbox.pdmodel.font.PDFont
|
import org.apache.pdfbox.pdmodel.font.PDFont
|
||||||
import org.xbib.graphics.pdfbox.groovy.Barcode
|
import org.xbib.graphics.pdfbox.groovy.Barcode
|
||||||
import org.xbib.graphics.pdfbox.groovy.Font
|
import org.xbib.graphics.pdfbox.groovy.Font
|
||||||
|
@ -15,7 +14,6 @@ import org.xbib.graphics.pdfbox.groovy.render.element.ImageElement
|
||||||
import org.xbib.graphics.pdfbox.groovy.render.element.LineElement
|
import org.xbib.graphics.pdfbox.groovy.render.element.LineElement
|
||||||
import org.xbib.graphics.pdfbox.groovy.render.element.TextElement
|
import org.xbib.graphics.pdfbox.groovy.render.element.TextElement
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
class ParagraphParser {
|
class ParagraphParser {
|
||||||
|
|
||||||
static List<ParagraphLine> getLines(TextBlock paragraph, BigDecimal maxLineWidth) {
|
static List<ParagraphLine> getLines(TextBlock paragraph, BigDecimal maxLineWidth) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.xbib.graphics.pdfbox.groovy.render
|
package org.xbib.graphics.pdfbox.groovy.render
|
||||||
|
|
||||||
import groovy.util.logging.Log4j2
|
|
||||||
import org.apache.pdfbox.pdmodel.PDPageContentStream
|
import org.apache.pdfbox.pdmodel.PDPageContentStream
|
||||||
import org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject
|
import org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject
|
||||||
import org.apache.pdfbox.pdmodel.graphics.image.JPEGFactory
|
import org.apache.pdfbox.pdmodel.graphics.image.JPEGFactory
|
||||||
|
@ -23,7 +22,6 @@ import org.xbib.graphics.pdfbox.groovy.render.element.TextElement
|
||||||
import javax.imageio.ImageIO
|
import javax.imageio.ImageIO
|
||||||
import java.awt.image.BufferedImage
|
import java.awt.image.BufferedImage
|
||||||
|
|
||||||
@Log4j2
|
|
||||||
class ParagraphRenderer implements Renderable {
|
class ParagraphRenderer implements Renderable {
|
||||||
|
|
||||||
TextBlock node
|
TextBlock node
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package org.xbib.graphics.pdfbox.groovy.test
|
package org.xbib.graphics.pdfbox.groovy.test
|
||||||
|
|
||||||
import groovy.util.logging.Log4j2
|
import groovy.util.logging.Log
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.xbib.graphics.pdfbox.groovy.analyze.DocumentAnalyzer
|
import org.xbib.graphics.pdfbox.groovy.analyze.DocumentAnalyzer
|
||||||
|
|
||||||
@Log4j2
|
@Log
|
||||||
class DocumentAnalyzerTest {
|
class DocumentAnalyzerTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -12,17 +12,16 @@ class DocumentAnalyzerTest {
|
||||||
InputStream inputStream = getClass().getResourceAsStream("/ghost.pdf")
|
InputStream inputStream = getClass().getResourceAsStream("/ghost.pdf")
|
||||||
if (inputStream) {
|
if (inputStream) {
|
||||||
DocumentAnalyzer documentAnalyzer = new DocumentAnalyzer(inputStream)
|
DocumentAnalyzer documentAnalyzer = new DocumentAnalyzer(inputStream)
|
||||||
log.info(documentAnalyzer.result)
|
log.info(documentAnalyzer.result as String)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = IOException.class)
|
@Test(expected = IOException.class)
|
||||||
void analyzeNonPDF() {
|
void analyzeNonPDF() {
|
||||||
InputStream inputStream = getClass().getResourceAsStream("/log4j2-test.xml")
|
InputStream inputStream = getClass().getResourceAsStream("/logging.properties")
|
||||||
if (inputStream) {
|
if (inputStream) {
|
||||||
DocumentAnalyzer documentAnalyzer = new DocumentAnalyzer(inputStream)
|
DocumentAnalyzer documentAnalyzer = new DocumentAnalyzer(inputStream)
|
||||||
log.info(documentAnalyzer.result)
|
log.info(documentAnalyzer.result as String)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package org.xbib.graphics.pdfbox.groovy.test
|
package org.xbib.graphics.pdfbox.groovy.test
|
||||||
|
|
||||||
import groovy.util.logging.Log4j2
|
import groovy.util.logging.Log
|
||||||
import org.xbib.graphics.pdfbox.groovy.Font
|
import org.xbib.graphics.pdfbox.groovy.Font
|
||||||
import org.xbib.graphics.pdfbox.groovy.builder.PdfFont
|
import org.xbib.graphics.pdfbox.groovy.builder.PdfFont
|
||||||
import spock.lang.Specification
|
import spock.lang.Specification
|
||||||
|
|
||||||
@Log4j2
|
@Log
|
||||||
class FontSpec extends Specification {
|
class FontSpec extends Specification {
|
||||||
|
|
||||||
def "override properties with left shift"() {
|
def "override properties with left shift"() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package org.xbib.graphics.pdfbox.groovy.test
|
package org.xbib.graphics.pdfbox.groovy.test
|
||||||
|
|
||||||
import groovy.util.logging.Log4j2
|
import groovy.util.logging.Log
|
||||||
import org.apache.fontbox.ttf.CmapSubtable
|
import org.apache.fontbox.ttf.CmapSubtable
|
||||||
import org.apache.fontbox.ttf.NamingTable
|
import org.apache.fontbox.ttf.NamingTable
|
||||||
import org.apache.fontbox.ttf.TTFParser
|
import org.apache.fontbox.ttf.TTFParser
|
||||||
|
@ -10,7 +10,7 @@ import org.junit.Test
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Paths
|
import java.nio.file.Paths
|
||||||
|
|
||||||
@Log4j2
|
@Log
|
||||||
class LoadFontTest {
|
class LoadFontTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -33,7 +33,7 @@ class LoadFontTest {
|
||||||
try {
|
try {
|
||||||
NamingTable nameTable = trueTypeFont.getNaming()
|
NamingTable nameTable = trueTypeFont.getNaming()
|
||||||
if (!nameTable) {
|
if (!nameTable) {
|
||||||
log.warn("Missing 'name' table in font " + name)
|
log.warning("Missing 'name' table in font " + name)
|
||||||
} else {
|
} else {
|
||||||
if (nameTable.getPostScriptName()) {
|
if (nameTable.getPostScriptName()) {
|
||||||
String psName = nameTable.getPostScriptName()
|
String psName = nameTable.getPostScriptName()
|
||||||
|
@ -48,12 +48,12 @@ class LoadFontTest {
|
||||||
log.info(format + ": '" + psName + "' / '" + nameTable.getFontFamily() +
|
log.info(format + ": '" + psName + "' / '" + nameTable.getFontFamily() +
|
||||||
"' / '" + nameTable.getFontSubFamily() + "'")
|
"' / '" + nameTable.getFontSubFamily() + "'")
|
||||||
} else {
|
} else {
|
||||||
log.warn("Missing 'name' entry for PostScript name in font " + inputStream)
|
log.warning("Missing 'name' entry for PostScript name in font " + inputStream)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CmapSubtable cmapSubtable = trueTypeFont.getUnicodeCmap(true)
|
CmapSubtable cmapSubtable = trueTypeFont.getUnicodeCmap(true)
|
||||||
if (!cmapSubtable) {
|
if (!cmapSubtable) {
|
||||||
log.warn('missing cmap table in ' + name)
|
log.warning('missing cmap table in ' + name)
|
||||||
} else {
|
} else {
|
||||||
log.info("cmap table present: " + name)
|
log.info("cmap table present: " + name)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package org.xbib.graphics.pdfbox.groovy.test
|
package org.xbib.graphics.pdfbox.groovy.test
|
||||||
|
|
||||||
import groovy.util.logging.Log4j2
|
import groovy.util.logging.Log
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
import org.xbib.graphics.barcode.SymbolType
|
import org.xbib.graphics.barcode.SymbolType
|
||||||
import org.xbib.graphics.pdfbox.groovy.builder.PdfDocumentBuilder
|
import org.xbib.graphics.pdfbox.groovy.builder.PdfDocumentBuilder
|
||||||
|
@ -11,7 +11,7 @@ import java.util.regex.Pattern
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue
|
import static org.junit.Assert.assertTrue
|
||||||
|
|
||||||
@Log4j2
|
@Log
|
||||||
class PdfDocumentBuilderTest {
|
class PdfDocumentBuilderTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration status="OFF">
|
|
||||||
<appenders>
|
|
||||||
<Console name="Console" target="SYSTEM_OUT">
|
|
||||||
<PatternLayout pattern="[%d{ISO8601}][%-5p][%-25c][%t] %m%n"/>
|
|
||||||
</Console>
|
|
||||||
</appenders>
|
|
||||||
<Loggers>
|
|
||||||
<Root level="debug">
|
|
||||||
<AppenderRef ref="Console" />
|
|
||||||
</Root>
|
|
||||||
</Loggers>
|
|
||||||
</configuration>
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
handlers = java.util.logging.ConsoleHandler
|
||||||
|
.level = ALL
|
||||||
|
java.util.logging.SimpleFormatter.format = %1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL %4$-7s [%3$s] %5$s %6$s%n
|
||||||
|
java.util.logging.ConsoleHandler.level = FINE
|
||||||
|
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
|
|
@ -18,6 +18,4 @@ module org.xbib.graphics.layout.pdfbox {
|
||||||
requires org.xbib.settings.datastructures;
|
requires org.xbib.settings.datastructures;
|
||||||
requires transitive java.desktop;
|
requires transitive java.desktop;
|
||||||
requires java.logging;
|
requires java.logging;
|
||||||
requires io.sf.carte.echosvg.anim;
|
|
||||||
requires io.sf.carte.echosvg.bridge;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
dependencies {
|
dependencies {
|
||||||
api "org.apache.pdfbox:pdfbox:${project.property('pdfbox.version')}"
|
api "org.apache.pdfbox:pdfbox:${project.property('pdfbox.version')}"
|
||||||
testImplementation "org.jfree:jfreechart:${project.property('jfreechart.version')}"
|
testImplementation "org.jfree:jfreechart:${project.property('jfreechart.version')}"
|
||||||
testImplementation "io.sf.carte:echosvg-bridge:${project.property('echosvg.version')}"
|
//testImplementation "io.sf.carte:echosvg-bridge:${project.property('echosvg.version')}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.xbib.graphics.pdfbox.test;
|
package org.xbib.graphics.pdfbox.test;
|
||||||
|
|
||||||
|
/*
|
||||||
import io.sf.carte.echosvg.anim.dom.SAXSVGDocumentFactory;
|
import io.sf.carte.echosvg.anim.dom.SAXSVGDocumentFactory;
|
||||||
import io.sf.carte.echosvg.bridge.BridgeContext;
|
import io.sf.carte.echosvg.bridge.BridgeContext;
|
||||||
import io.sf.carte.echosvg.bridge.DocumentLoader;
|
import io.sf.carte.echosvg.bridge.DocumentLoader;
|
||||||
|
@ -7,6 +8,8 @@ import io.sf.carte.echosvg.bridge.GVTBuilder;
|
||||||
import io.sf.carte.echosvg.bridge.UserAgent;
|
import io.sf.carte.echosvg.bridge.UserAgent;
|
||||||
import io.sf.carte.echosvg.bridge.UserAgentAdapter;
|
import io.sf.carte.echosvg.bridge.UserAgentAdapter;
|
||||||
import io.sf.carte.echosvg.gvt.GraphicsNode;
|
import io.sf.carte.echosvg.gvt.GraphicsNode;
|
||||||
|
*/
|
||||||
|
|
||||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||||
import org.apache.pdfbox.pdmodel.PDPage;
|
import org.apache.pdfbox.pdmodel.PDPage;
|
||||||
import org.apache.pdfbox.pdmodel.PDPageContentStream;
|
import org.apache.pdfbox.pdmodel.PDPageContentStream;
|
||||||
|
@ -61,7 +64,7 @@ public class RenderSVGsTest extends PdfBoxGraphics2DTestBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderSVG(String name, final double scale) throws IOException {
|
private void renderSVG(String name, final double scale) throws IOException {
|
||||||
String uri = RenderSVGsTest.class.getResource(name).toString();
|
/*String uri = RenderSVGsTest.class.getResource(name).toString();
|
||||||
SAXSVGDocumentFactory f = new SAXSVGDocumentFactory();
|
SAXSVGDocumentFactory f = new SAXSVGDocumentFactory();
|
||||||
Document document = f.createDocument(uri, RenderSVGsTest.class.getResourceAsStream(name));
|
Document document = f.createDocument(uri, RenderSVGsTest.class.getResourceAsStream(name));
|
||||||
UserAgent userAgent = new UserAgentAdapter();
|
UserAgent userAgent = new UserAgentAdapter();
|
||||||
|
@ -73,11 +76,11 @@ public class RenderSVGsTest extends PdfBoxGraphics2DTestBase {
|
||||||
this.exportGraphic("svg", name.replace(".svg", ""), gfx -> {
|
this.exportGraphic("svg", name.replace(".svg", ""), gfx -> {
|
||||||
gfx.scale(scale, scale);
|
gfx.scale(scale, scale);
|
||||||
gvtRoot.paint(gfx);
|
gvtRoot.paint(gfx);
|
||||||
});
|
});*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderSVGCMYK(String name, double scale) throws IOException {
|
private void renderSVGCMYK(String name, double scale) throws IOException {
|
||||||
String uri = RenderSVGsTest.class.getResource(name).toString();
|
/*String uri = RenderSVGsTest.class.getResource(name).toString();
|
||||||
SAXSVGDocumentFactory documentFactory = new SAXSVGDocumentFactory();
|
SAXSVGDocumentFactory documentFactory = new SAXSVGDocumentFactory();
|
||||||
Document document = documentFactory.createDocument(uri, RenderSVGsTest.class.getResourceAsStream(name));
|
Document document = documentFactory.createDocument(uri, RenderSVGsTest.class.getResourceAsStream(name));
|
||||||
UserAgent userAgent = new UserAgentAdapter();
|
UserAgent userAgent = new UserAgentAdapter();
|
||||||
|
@ -117,6 +120,6 @@ public class RenderSVGsTest extends PdfBoxGraphics2DTestBase {
|
||||||
contentStream.close();
|
contentStream.close();
|
||||||
String baseName = name.substring(0, name.lastIndexOf('.'));
|
String baseName = name.substring(0, name.lastIndexOf('.'));
|
||||||
pdfDocument.save(new File(parentDir, baseName + ".pdf"));
|
pdfDocument.save(new File(parentDir, baseName + ".pdf"));
|
||||||
pdfDocument.close();
|
pdfDocument.close();*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue