Giter Site home page Giter Site logo

fugerit-org / fj-doc Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 1.0 4.55 MB

Fugerit Document Generation Framework (fj-doc)Fugerit Doc

Home Page: https://www.fugerit.org/perm/venus/

License: Apache License 2.0

Java 67.17% HTML 18.04% CSS 0.33% JavaScript 3.53% FreeMarker 10.72% Dockerfile 0.11% Kotlin 0.10%
apache-fop apache-poi csv csv-generator excel excel-generation freemarker html html-generation java markdown markdown-generator maven maven-pom opencsv pdf pdf-generation quarkus xls xlsx

fj-doc's People

Contributors

daneeldeveloper avatar dependabot[bot] avatar fugerit79 avatar mttfranci avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

daneeldeveloper

fj-doc's Issues

[fj-doc-mod-fop] fail to create a PDF which is both compliant to PDF/A-1b and PDF/UA-1

It seems setting both PDF/A and PDF/UA profile leads to this error on PDF/A validation :

"XMP property pdfuaid:part not defined in current schema."

Whereas PDF/UA validation succeds

PDF/A checked with : https://avepdf.com/en/pdfa-validation ( and Adobe )
PDF/UA checked with : https://check.axes4.com/en/

Here is a simple output of a PDF/A-1b and PDF/UA-1

Actually it seems that this property is added to the output PDF :

        <rdf:Description xmlns:pdfuaid="http://www.aiim.org/pdfua/ns/id/" rdf:about="">
            <pdfuaid:part>1</pdfuaid:part>
        </rdf:Description>

Which is leading to the validation error.

[fj-doc-mod-fop] add pdf/a support

Adding support for pdf/a format.

The concept of format has been introduced.
By default the format is the same as the type (pdf, xlsx, html etc).

It is possible now to add format for the same type.

The DocHandlerFacade can handle multiple handlers for the same type, as long as the format is diffirent.

For instance we can have a normal pdf handler (type : pdf, format : pdf) and a pdf a handler (type : pdf, format : PDF/A-1a).

An example in the fj-doc-sample project will be provided.

[mod-fop] fix cell vertifcal align

Vertical alignment in mod-fop cell it's not wotking :

        <cell valign="middle">
          <para>Elrond</para>
        </cell>
        <cell valign="bottom">
          <para>Gil-Galad</para>
        </cell>

[fj-doc-base] Managing of unsafe DocTypeHandler for DocHandlerFactory

The class DocHandlerFactory offers a conveniente system to load and register type handler, but if even just one type handler is not found, the load process will fail.

It would be better if it was possible to tag handlers entry as "unsafe" (in which case the factory creations should not safe if the handler is not found).

	<factory id="unsafe-test">
		<data id="html-fm" info="html" type="org.fugerit.java.doc.freemarker.html.FreeMarkerHtmlTypeHandlerUTF8" />	
		<data id="html-fragment-fm" info="fhtml" type="org.fugerit.java.doc.freemarker.html.FreeMarkerHtmlFragmentTypeHandlerUTF8" />
		<data id="pdf-unsafe" info="pdf" type="org.fugerit.java.doc.pdf.UnsafeDocHandler" />
	</factory>

Imagine the last handler is not available in class loader. Thi can be handled with the new properties :

unsafe="true" unsafeMode="log-trace"

	<factory id="unsafe-test">
		<data id="html-fm" info="html" type="org.fugerit.java.doc.freemarker.html.FreeMarkerHtmlTypeHandlerUTF8" />	
		<data id="html-fragment-fm" info="fhtml" type="org.fugerit.java.doc.freemarker.html.FreeMarkerHtmlFragmentTypeHandlerUTF8" />
		<data id="pdf-unsafe" info="pdf" type="org.fugerit.java.doc.pdf.UnsafeDocHandler" unsafe="true" unsafeMode="log-trace"/>
	</factory>

The stack trace will be logged only if you set unsafeMod to log-trace. If you want to suppress the stack trace use :

unsafe="true" unsafeMode="log-message"

Javadoc generations with older versions of jdk 11 fails

The project build successfully with oracle jdk 11.0.16.1 and higher.

Previous implementation may failes with maven build profile 'full' when generating javadoc of auto generated sources from jaxb in module fj-doc-lib-autodoc.

[fj-doc-mod-poi] On linux sometimes you may get a java.lang.InternalError on org.fugerit.java.doc.mod.poi.PoiUtils.resizeSheet()

On linux server with no graphical interface, is possible to get the an error when invoking :
at org.fugerit.java.doc.mod.poi.PoiUtils.resizeSheet()
For instance on :
at org.fugerit.java.doc.mod.poi.BasicPoiTypeHandler.handle()

Tested on jdk : jdk-11.0.16.1 (for linux arm)

Fix : install the fontconfig package on your system. (source)

Here is a sample stack trace for version fj-doc-mod-poi version 0.7.2

java.lang.InternalError: java.lang.reflect.InvocationTargetException
	at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
	at java.desktop/java.awt.Font.getFont2D(Font.java:497)
	at java.desktop/java.awt.Font.canDisplayUpTo(Font.java:2250)
	at java.desktop/java.awt.font.TextLayout.singleFont(TextLayout.java:469)
	at java.desktop/java.awt.font.TextLayout.<init>(TextLayout.java:530)
	at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:273)
	at org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:248)
	at org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:233)
	at org.apache.poi.xssf.usermodel.XSSFSheet.autoSizeColumn(XSSFSheet.java:555)
	at org.apache.poi.xssf.usermodel.XSSFSheet.autoSizeColumn(XSSFSheet.java:537)
	at org.fugerit.java.doc.mod.poi.PoiUtils.resizeSheet(PoiUtils.java:17)
	at org.fugerit.java.doc.mod.poi.PoiUtils.autoSizeColumns(PoiUtils.java:25)
	at org.fugerit.java.doc.mod.poi.BasicPoiTypeHandler.handle(BasicPoiTypeHandler.java:292)
	at org.fugerit.java.doc.lib.simpletable.SimpleTableDocConfig.processSimpleTable(SimpleTableDocConfig.java:60)
	at org.fugerit.java.doc.playground.doc.GenerateRest.validate(GenerateRest.java:142)
	at org.fugerit.java.doc.playground.doc.GenerateRest_ClientProxy.validate(Unknown Source)
	at org.fugerit.java.doc.playground.doc.GenerateRest$quarkusrestinvoker$validate_9602abc43de303ad70b38c0fbaa7c81272957d46.invoke(Unknown Source)
	at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
	at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:114)
	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:145)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84)
	... 28 more
Caused by: java.lang.NullPointerException
	at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
	at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
	at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
	at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
	at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:379)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:324)
	at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
	at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.