How to create a PDF document from the (UI) form or BDM data?

1
+1
-1

Hi,

my requirement is to have the data entered into a form saved as PDF file. Can this be done somehow?
Using Bonita 7.2.3 CE.

Thanks
ktp

ps. Would prefer a solution that wouldn't use jasper

Comments

Submitted by kari.paukku on Sun, 05/08/2016 - 11:16

Update: have managed to create and write static text to a text file, using Groovy Script connector.

testing now using PDFBox PDFBox example

but getting "class not found" error - where should I put the required .jar file so that bonita/Groovy can see it?

Thanks,
ktp

Submitted by kari.paukku on Sun, 05/08/2016 - 13:07

Hi again,
did add the pdfbox-app-2.0.1.jar to Bonita using "Development-Manage Jars".

The Groovy editor does not give any errors so I'm assuming that the script is ok the development environment can find all required jars.

Its first when running the process that the error gets written to the log. Below is the start of the error message

org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: org/apache/ivy/core/report/ResolveReport
        at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:274)
        at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnector(ConnectorServiceImpl.java:147)
        at org.bonitasoft.engine.connector.ConnectorServiceDecorator.executeConnector(ConnectorServiceDecorator.java:114)
        at org.bonitasoft.engine.execution.work.ExecuteConnectorWork.work(ExecuteConnectorWork.java:138)
        at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
        at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
        at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
        at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)

ktp

Submitted by Sean McP on Sun, 05/08/2016 - 14:29

you need to get the IVY jar and add that to the tomcat lib, that should help,

regards

Submitted by kari.paukku on Sun, 05/08/2016 - 15:21

yes, that did the trick. I can now create PDF file using a Groovy script connector and the PDFBox.
Thanks.
ktp

3 answers

1
0
-1
This one is the BEST answer!

the answer is in the comments - it can be done this way. Thanks Sean.

Comments

Submitted by kandji.sokhna on Tue, 05/10/2016 - 22:52

Hi

Could you please explain me How you manage to do it . Can I have a detail about your groovy script. Four months now I'm looking for how to do it. I've used itext but it doesn't works. I have Bonita 7.2.2.

Thanks

Submitted by kari.paukku on Wed, 05/11/2016 - 01:36

Hi,
I don't think I did anything that special.
0) added the pdfbox-app-2.0.1.jar to Bonita using "Development-Manage Jars".
1) took the code available directly from this link https://gist.github.com/kimukou/749476
2) did put the script to a task - pmzMDVg1p
4) lastly did include IVY.jar as Sean suggested "you need to get the IVY jar and add that to the tomcat lib,"

Then it worked.

Hope this helps.
ktp

1
0
-1

I add the ivy.jar but still getting that error

1
0
-1

where is the pdf created?
what type of variable did you store the result ?

Notifications