scriptlet4docx icon indicating copy to clipboard operation
scriptlet4docx copied to clipboard

Method code too large

Open ortizman opened this issue 7 years ago • 2 comments

I have a very large document (more than 200 forms). The first forms worked without problems. Currently I started to give the following error

Method code too large!

Stack: groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed: General error during class generation: Method code too large!

For what you can see is a limitation of the size of Java methods https://stackoverflow.com/questions/24256316/method-code-too-large-in-groovy-grails

Any known workarround?

ortizman avatar Aug 10 '18 19:08 ortizman

Okay. In case someone has the same problem. Overrride the processCleanedTemplate method of the DocxTemplater class to add a new expression "<! = BREAK!>" in this way, I batch process the docx scripts and it allows me to scale to large document

ortizman avatar Aug 14 '18 15:08 ortizman

Could you attack example of the document?

snowindy avatar Mar 03 '19 13:03 snowindy