scriptlet4docx icon indicating copy to clipboard operation
scriptlet4docx copied to clipboard

Add DocxTemplaterBulk

Open ortizman opened this issue 7 years ago • 4 comments

With this template engine, the library can process docx with many more scripts Fix #21

ortizman avatar Aug 21 '18 15:08 ortizman

@snowindy

ortizman avatar Aug 21 '18 15:08 ortizman

Thank you for the contribution, I will check it and try to merge if it's alright!

snowindy avatar Aug 21 '18 15:08 snowindy

Hi! Sorry for being late! Could you please give me an example document that gives "Method code too large!" error?

I think that manually adding BREAK tag somewhere in a document is a hack and it gives bad user experience. That is, if you are new library user, you won't know this, and just think it's malfunctioning.

I think I can invent a way to avoid error "Method code too large!" without it, with your example to reproduce.

snowindy avatar Mar 03 '19 12:03 snowindy

Hi! Sorry for being late! Could you please give me an example document that gives "Method code too large!" error?

I think that manually adding BREAK tag somewhere in a document is a hack and it gives bad user experience. That is, if you are new library user, you won't know this, and just think it's malfunctioning.

I think I can invent a way to avoid error "Method code too large!" without it, with your example to reproduce.

@snowindy I created a unity test to reproduce the limitation. DocxTemplateBulk passes it and DocxTemplate does not (expected=RuntimeException.class) I really tried not to add the BREAK. But I can't imagine an alternative that doesn't require breaking the document and processing it in parts, since it is a limitation of the JVM. https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.9.1

An alternative would be to process the document in parts in a way that is transparent to the client of the library. But this leads to the problem of knowing where to make the cut without breaking any scriptlet.

At the moment this hack is being used productively in several documents, many larger than the test file, without drawbacks

ortizman avatar Mar 04 '19 20:03 ortizman