Groovy - need to make a printable form

2019-09-19 01:40发布

问题:

Probably need title help as I mean a literal paper form, not an HTML element. I have this PDF form I email everyone after they use my site, and I have to manually enter a couple fields the database knows. I am looking for a good method to have Groovy make a pdf or something like that.

What I am going to attempt: Make the form in Word, save as XML, put XML as groovy String and ${someVariable} everywhere I need filled in. Open XML in Word and then print as PDF.

Is there a better way? I have Acrobat, but if there is a way without it that's even better.

I am running into a problem which I will ask as a separate question, so get ready for a link hereish. UPDATE: Groovy says my Unicode string is too long

iText is not an option until they get back to me Re: licensing which also excludes the plugin Jared mentions (it is based on iText).

Apache thing seems to be about as hard to learn as making my rube goldberg...

回答1:

I haven't used this but take a look at the PDF Plugin It looks like you can create a standard grails view containing the info you want and generate a PDF from it. I wish I had used this for my PDF generation needs.