craigburke / document-builder Goto Github PK
View Code? Open in Web Editor NEWGroovy Document Builder
Groovy Document Builder
In pdf builder is possible to set vertical text. Something like css vertical text. Here is a demo https://davidwalsh.name/demo/css-vertical-text.php
Hello,
the text can be aligned right, left and center, but not justified. Is this right?
I am working on a project and the paragraph has to be formatted justified.
Did anyone do this before and can help me?
Thanks! :)
I would like to style some element border individually in a way where i could set border-top to 0.inch border-right to 1.inch.
I'm trying to include an image of a radio button multiple times, and getting an error
(please note that I'm only getting this when running as war deployed to tomcat - running from grails run-app doesn't throw this error)
java.util.zip.ZipException: duplicate entry: word/media/243c61aa8c2b9b5aaab56e685461363ef6d66201.jpg
at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:232)
at sun.reflect.GeneratedMethodAccessor959.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.craigburke.document.builder.WordDocument$_addImageFiles_closure5$_closure11.doCall(WordDocument.groovy:145)
at sun.reflect.GeneratedMethodAccessor961.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056)
at org.codehaus.groovy.runtime.dgm$162.doMethodInvoke(Unknown Source)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.craigburke.document.builder.WordDocument$_addImageFiles_closure5.doCall(WordDocument.groovy:144)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.Closure.call(Closure.java:414)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForMapEntry(DefaultGroovyMethods.java:5226)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2107)
at org.codehaus.groovy.runtime.dgm$163.doMethodInvoke(Unknown Source)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.craigburke.document.builder.WordDocument.addImageFiles(WordDocument.groovy:143)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:158)
at com.craigburke.document.builder.WordDocument.generateDocument(WordDocument.groovy:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.craigburke.document.builder.WordDocumentBuilder.writeDocument(WordDocumentBuilder.groovy:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at com.craigburke.document.core.factory.DocumentFactory.onNodeCompleted(DocumentFactory.groovy:29)
at groovy.util.FactoryBuilderSupport.nodeCompleted(FactoryBuilderSupport.java:998)
at groovy.util.FactoryBuilderSupport.dispatchNodeCall(FactoryBuilderSupport.java:896)
at groovy.util.FactoryBuilderSupport.doInvokeMethod(FactoryBuilderSupport.java:781)
at groovy.util.FactoryBuilderSupport.invokeMethod(FactoryBuilderSupport.java:501)
at com.craigburke.document.core.builder.DocumentBuilder.super$4$invokeMethod(DocumentBuilder.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
at com.craigburke.document.core.builder.DocumentBuilder$_invokeMethod_closure1.doCall(DocumentBuilder.groovy:57)
at com.craigburke.document.core.builder.DocumentBuilder$_invokeMethod_closure1.doCall(DocumentBuilder.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:408)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:110)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.access$400(GroovyCategorySupport.java:68)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:250)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.use(DefaultGroovyMethods.java:407)
at org.codehaus.groovy.runtime.dgm$755.doMethodInvoke(Unknown Source)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:64)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
at com.craigburke.document.core.builder.DocumentBuilder.invokeMethod(DocumentBuilder.groovy:56)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:446)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:369)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
at org.newteachercenter.MainController$_exportWord_closure31.doCall(MainController.groovy:1007)
at org.newteachercenter.MainController$_exportWord_closure31.doCall(MainController.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:408)
at groovy.util.FactoryBuilderSupport.dispatchNodeCall(FactoryBuilderSupport.java:889)
at groovy.util.FactoryBuilderSupport.doInvokeMethod(FactoryBuilderSupport.java:781)
at groovy.util.FactoryBuilderSupport.invokeMethod(FactoryBuilderSupport.java:501)
at com.craigburke.document.core.builder.DocumentBuilder.super$4$invokeMethod(DocumentBuilder.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
at com.craigburke.document.core.builder.DocumentBuilder$_invokeMethod_closure1.doCall(DocumentBuilder.groovy:57)
at com.craigburke.document.core.builder.DocumentBuilder$_invokeMethod_closure1.doCall(DocumentBuilder.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:408)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:110)
at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.access$400(GroovyCategorySupport.java:68)
at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:250)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.use(DefaultGroovyMethods.java:407)
at org.codehaus.groovy.runtime.dgm$755.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoMetaMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:251)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
at com.craigburke.document.core.builder.DocumentBuilder.invokeMethod(DocumentBuilder.groovy:56)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.newteachercenter.MainController.exportWord(MainController.groovy:1006)
at org.newteachercenter.MainController.exportWord(MainController.groovy)
at org.grails.core.DefaultGrailsControllerClass$MethodHandleInvoker.invoke(DefaultGrailsControllerClass.java:222)
at org.grails.core.DefaultGrailsControllerClass.invoke(DefaultGrailsControllerClass.java:187)
at org.grails.web.mapping.mvc.UrlMappingsInfoHandlerAdapter.handle(UrlMappingsInfoHandlerAdapter.groovy:89)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:281)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:115)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
at grails.plugin.springsecurity.web.UpdateRequestContextHolderExceptionTranslationFilter.doFilter(UpdateRequestContextHolderExceptionTranslationFilter.groovy:64)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.groovy:53)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:157)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:205)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.groovy:62)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.groovy:58)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:75)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:103)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.boot.context.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:120)
at org.springframework.boot.context.web.ErrorPageFilter.access$000(ErrorPageFilter.java:61)
at org.springframework.boot.context.web.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:95)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.boot.context.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:113)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Should be able to have cells with a fixed height.
There is a typo on line 78 in WordDocument.groovy. The content type is prefixed with "conte".
conteapplication/vnd.openxmlformats-package.core-properties+xml
The interesting thing is that Microsoft Word does not seems to care, it opens documents without complaining.
@craigburke I can create a pull request, but it's so simple so maybe you want to fix it on master?
I'm new to document builder. Is it possible to adjust the row height / cell height within a table. I can't seem to make the row height any slimmer.
In a table where you have both colspan and rowspan, the calculation gets a bit messed up.
For example:
table {
row {
cell "Vspan of two", rowspan: 2
cell "Span of two", colspan: 2
cell "Span of three", colspan: 3
cell "Vspan of two", rowspan: 2
cell "Vspan of two", rowspan: 2
cell "Vspan of two", rowspan: 2
}
row(style: 'header') {
cell "First of two"
cell "Second of two"
cell "First of three"
cell "Second of three"
cell "Third of three"
}
The second row is all misaligned.
This is because the calculation of where to re-insert the rowspan cell in core...Table.groovy specifically https://github.com/craigburke/document-builder/blob/master/core/src/main/groovy/com/craigburke/document/core/Table.groovy#L70 the column index used does not take into account the colspans.
So in my example the three latter rowspans get inserted into the second row at indexes 3, 4, & 5 rather than 6, 7, & 8 like they should be.
I tried to fix it but I could get it to compile on my machine (but that is me rather than anything of yours as my gradle is a bit messed up!).
Below is a sample groovy script that in the generated PDF have "think" and then "k my" in the following line. Wording is a modified version of text received directly from user input (word pasting)
@Grab(group='com.craigburke.document', module='pdf', version='0.4.14')
import com.craigburke.document.builder.PdfDocumentBuilder
import java.text.Normalizer
String cleanupText(String s)
{
def newText = s.replaceAll(~/\u2019/,"'")
newText = newText.replaceAll(~/\u2013/,"--")
return Normalizer.normalize(newText, Normalizer.Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}+", "")
}
def builders = [
new PdfDocumentBuilder(new File('example.pdf')),
]
def text = """I have a very diverse set of skills. As an student, I’m also pursuing another minor, which means that I have a decent background in both other disciplines. Because of this, I think my skillset is best suited for a project that requires (and utilizes) a solid understanding of all of these.\r
\r
"""
builders.each { builder ->
builder.create { document(font: [family: 'Helvetica', size: 14.pt], margin: [top: 0.75.inches]) {
paragraph "${cleanupText(text)}", font: [size: 12.pt]
}}
}
Support for adding links. You should be able to set a url on a header, paragraph, or text section.
Are images in table cells supported?
Tried to add
cell {
paragraph {
image(data: radio, width: 15, height: 15, name:"radiobutton")
}
}
but the image is never inserted. paragraph > image outside of table seems to work. Is there some other syntax i'm missing?
Links seem to be supported but unable to find example in documentation or test cases
I am trying to use groovy document builder in a grails 2.3.8 app but when i try a simple example i get the following error
URI
/appName/controllerName/actionName
Class
java.lang.NoClassDefFoundError
Message
Could not initialize class com.craigburke.document.core.builder.RenderState
Thanks to https://objectpartners.com/2015/05/14/list-of-groovy-versions-for-each-version-of-grails/ article i got to see that grails 2.3.8 use groovy 2.1.9. This is the same groovy version from grails 2.3.2 until 2.3.11
I tried the same code in a grails 2.4.0 that use groovy 2.3 and groovy document builder works as expected
Hey,
may someone help me?
I get the error: "java.lang.NullPointerException: Cannot get property 'embeddedFonts' on null object" when trying to load a custom Font.
`private def generatePDF(reportData) {
def builder = new com.craigburke.document.builder.PdfDocumentBuilder(new ByteArrayOutputStream())
def data = reportData.first()
byte[] uniLogoImageData = getClass().classLoader.getResource('grails-app/assets/images/head.gif')?.bytes
byte[] zflLogoImageData = getClass().classLoader.getResource('grails-app/assets/images/zfl-logo.jpg')?.bytes
builder.create {
def font = [color: "black", size: 10.5.pt]
document(font: font
,addFont('/grails-app/assets/SanMS.ttf', name: 'SanMS')
, log.debug(getFont())
,log.debug(addFont)
, margin: [top: 0, right: 0]
, pageCount: 2
, footer: { info ->
table(columns: [1, 0.6, 0.7], margin: [left: -0.18.inches], border: [size: 0]) {
...
}
}
) }
def embeddedFont = document?.embeddedFonts?.first()
log.debug(embeddedFont)
builder.out.toByteArray()
}`
Thanks! :)
Vertical alignment is fixed to 'top' in 0.4.15 (at least in WordDocumentBuilder). It would be great if we could specify vertical alignment for a cell. Something like this: cell(align: 'center', vAlign: 'bottom')
When trying to build complex pdf then sometimes the code keeps running and never returns from onTableComplete closure of PdfDocumentBuilder class.
For more details i have created a gist and a demo code please refer to
https://gist.github.com/upadhyayap/a351339ba8e8214d5d8c
Demo code can be found here https://github.com/upadhyayap/GdbDemo
We need the ability to set the background color on tables. This property should be able to be set at the Table, Row or Cell level.
If I run the example from the README file the table is malformed in LibreOffice: 4.2.8.2 / 420m0(Build:2)
The text from the cell runs out of the page. I've suspected tblGrid
section which is missing but adding it didn't make any difference.
The you can find the generated file here.
If I upload similar malformed file to Google Drive, on the other hand in preview the cells are narrower but doesn't stretch to 100% either.
My other suspect is wrong computation of the sizes.
The addEmbeddedFont
closure needs to be defined in the WordDocumentBuilder so that the fonts files are actually embedded within the Word Document.
def addEmbeddedFont = { EmbeddedFont embeddedFont ->
// Do Something
}
OutputStream out = new ByteArrayOutputStream()
def testText = "I don’t have very much experience with hardware or hacking (aside from high school robotics), but I am most willing to try.\r"
def builder = new PdfDocumentBuilder(out)
builder.create {
document(font: [family: 'Helvetica', size: 12.pt], margin: [top: 0.75.inches]) {
paragraph {
font.size = 18.pt
text "${testText}", font: [bold: true]
}
}
return out.toByteArray()
Using the above code, the output is:
"þÿ I d o n t h a v e v e r y m u c h e x p e r i e n c e w i t h hacking (aside from high school robotics), but I am
most willing to try".
Any user supplied 's seem to turn into empty character and mangled lines/fonts.
First off, thanks for building this amazing library.
I'm listing 'com.craigburke.document:pdf:0.4.2' as a maven dependency in intellij idea IDE. I then run the example groovy code you have provided on this repo's landing page. I get the following exception when I run the code. The error occurs when trying to insert the image. Removing the line of code which inserts the image does not result in any error. Any ideas as to what might be happening here or how to fix this?
Caught: java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.pdfbox.pdmodel.common.PDStream.<init>(PDStream.java:131)
at org.apache.pdfbox.pdmodel.graphics.xobject.PDJpeg.<init>(PDJpeg.java:104)
at com.craigburke.document.builder.render.ParagraphRenderer.renderImageElement(ParagraphRenderer.groovy:172)
at com.craigburke.document.builder.render.ParagraphRenderer.this$2$renderImageElement(ParagraphRenderer.groovy)
at com.craigburke.document.builder.render.ParagraphRenderer$_renderLine_closure3.doCall(ParagraphRenderer.groovy:139)
at com.craigburke.document.builder.render.ParagraphRenderer.renderLine(ParagraphRenderer.groovy:132)
at com.craigburke.document.builder.render.ParagraphRenderer.this$2$renderLine(ParagraphRenderer.groovy)
at com.craigburke.document.builder.render.ParagraphRenderer$_renderElement_closure1.doCall(ParagraphRenderer.groovy:102)
at com.craigburke.document.builder.render.ParagraphRenderer.renderElement(ParagraphRenderer.groovy:100)
at com.craigburke.document.builder.render.Renderable$Trait$Helper.render(Renderable.groovy:24)
at com.craigburke.document.builder.render.Renderable$Trait$Helper$render$0.call(Unknown Source)
at com.craigburke.document.builder.render.ParagraphRenderer.render(ParagraphRenderer.groovy)
at com.craigburke.document.builder.PdfDocumentBuilder$_closure3.doCall(PdfDocumentBuilder.groovy:57)
at com.craigburke.document.core.factory.ParagraphFactory.onNodeCompleted(ParagraphFactory.groovy:40)
at com.craigburke.document.core.builder.DocumentBuilder.super$4$invokeMethod(DocumentBuilder.groovy)
at com.craigburke.document.core.builder.DocumentBuilder$_invokeMethod_closure1.doCall(DocumentBuilder.groovy:56)
at com.craigburke.document.core.builder.DocumentBuilder$_invokeMethod_closure1.doCall(DocumentBuilder.groovy)
at com.craigburke.document.core.builder.DocumentBuilder.invokeMethod(DocumentBuilder.groovy:55)
at Example$_run_closure1$_closure2$_closure3.doCall(Example.groovy:43)
at Example$_run_closure1$_closure2$_closure3.doCall(Example.groovy)
at com.craigburke.document.core.builder.DocumentBuilder.super$4$invokeMethod(DocumentBuilder.groovy)
at com.craigburke.document.core.builder.DocumentBuilder$_invokeMethod_closure1.doCall(DocumentBuilder.groovy:56)
at com.craigburke.document.core.builder.DocumentBuilder$_invokeMethod_closure1.doCall(DocumentBuilder.groovy)
at com.craigburke.document.core.builder.DocumentBuilder.invokeMethod(DocumentBuilder.groovy:55)
at Example$_run_closure1$_closure2.doCall(Example.groovy:19)
at Example$_run_closure1$_closure2.doCall(Example.groovy)
at com.craigburke.document.core.builder.DocumentBuilder.super$4$invokeMethod(DocumentBuilder.groovy)
at com.craigburke.document.core.builder.DocumentBuilder$_invokeMethod_closure1.doCall(DocumentBuilder.groovy:56)
at com.craigburke.document.core.builder.DocumentBuilder$_invokeMethod_closure1.doCall(DocumentBuilder.groovy)
at com.craigburke.document.core.builder.DocumentBuilder.invokeMethod(DocumentBuilder.groovy:55)
at Example$_run_closure1.doCall(Example.groovy:18)
at Example.run(Example.groovy:17)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
If it helps, I've uploaded my idea project here. Also, please let me know if there is any other information that I can include that can help with this issue.
Thanks for your time,
Swarup.
Hello. I am trying to create a table with n rows where each row has two columns and each cell will contain a table.
If the table contains a single row i get what i am expecting
But if I add more rows the rows are overlapped
This is the code i am trying
`PdfDocumentBuilder builder = new PdfDocumentBuilder(response.outputStream)
builder.create {
document {
table {
row {
cell {
table {
row {
cell 'cell1'
cell 'cell2'
}
row {
cell 'cell3'
cell 'cell4'
}
}
}
cell {
table {
row {
cell 'cell1'
cell 'cell2'
}
row {
cell 'cell3'
cell 'cell4'
}
}
}
}
row {
cell {
table {
row {
cell 'cell1'
cell 'cell2'
}
row {
cell 'cell3'
cell 'cell4'
}
}
}
cell {
table {
row {
cell 'cell1'
cell 'cell2'
}
row {
cell 'cell3'
cell 'cell4'
}
}
}
}
}
}
}
response.contentType = "application/pdf"
response.setHeader("Content-disposition", "attachment;filename=printing.pdf")
response.outputStream.flush()`
If i try with paragraphs inside cells instead of nested tables i get what i am expecting
I am probably missing something. Thanks for any help
Should be able to create a simple unordered list
Render a table of contents based on the headings within the document.
Should be able to set a background on a text section to allow the text to be highlighted.
In one of my use-cases I need footers on all pages but no header on first page.
I tried to add an if-statement in the header block that just returns if I'm on the first page but then all headers disappeared. I use Spock to create/test the document during development. First I thought it was Spock magic that broke my logic, but I don't think so. Looking at WordDocumentBuilder I can see that if there's a header defined it gets rendered.
It would be great if we could have more flexibility with header and footer rendering.
But right now my only requirement is to not render header on page 1.
Currently the name attribute is required (and must be unique). We should make this an optional attribute and generate a unique name.
Apart from inches and pixels the UnitCategory
should support centimeters as well,
Add support for superscript or subscript text.
Need to add underline property to the Font class to allow text to be underlined.
def builder = new PdfDocumentBuilder(new File('example.pdf'))
builder.create {
document {
paragraph "ПРИВЕТ"
}
}
Exception thrown
java.lang.IllegalArgumentException: U+041F ('Pecyrillic') is not available in this font's encoding: WinAnsiEncoding
I am using groovy document builder in my current project and i have requirement to get pdf generated in multi languages like Chinese, Russian,Hindi and in many more languages. Earlier i was not able to do it even by using pdfBox because of https://issues.apache.org/jira/browse/PDFBOX-922 . But this issue is fixed in pdfBox 2.0.0 which is still in RC. SO do we have any plans for moving to pdfBox 2.0.0
I'm too lazy to type it out, so just look at this tweet:
https://twitter.com/craigburke1/status/652525996139225088
YOU ARE WASTING SO MUCH OF MY TIME WITH YOUR FREE SOFTWARE!!
😡 😡 😡
I would be great if the builder has support for bookmarking (see http://officeopenxml.com/WPbookmark.php)
Suggested DSL:
paragraph {
text "Topic", ref: "topic"
}
paragraph {
text "This is a "
text "link to bookmark", href: 'topic'
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.