Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Convert XFA Form Variable into a PDF Doc.

Avatar

Level 1

Hello,

       I need a solution regarding conversion of a xfa form variable into a pdf so that the solutions components like Digital Signatures, Rights Management can be implemented in the process at required places. I have a process where a user fills up a form and is sent to different users for approval based on my Business Logic. The input is a dynamic PDF which is mapped to a xfa variable which flows in the process. Some changes are required to be made in the form at various levels. For that i have mapped the xpath's to values i want to be displayed in the form at different places. Now The problem arrives when i want to implement a rights management service at Manager's level in the process. The input which this solution component takes is a pdf but i have a xfa form variable flowing in my process.

I have noticed tat many users in this forum are facing the same problem in one form or the other, none have got a convincing solution. So i would be very much grateful to a person who can provide step by step solution to this issue and solve the same. you would be helping many developers by providing the complete Solution.

Thanx in advance.

5 Replies

Avatar

Level 10

The easiest thing you be to

1- Add a renderPDFForm operation to create a PDF from an XDP file.

2- Pass the xfaForm's data (/process_data/xfaFormVar/object/data) to the data parameter of the renderPDFForm so that it merges the proper data with the XDP to re-create the PDF.

3- Add the usage rights to the PDF.

4- Create a new variable of type DocumentForm.

5- Use a SetValue to put the pdf created above in the DocumentForm variable (/process_data/DocFormVar/object/@document = /process_data/@newPDF).

6- Pass that DocumentForm variable as the input/output in the Form Data Mapping of the User step.

Jasmin

Avatar

Level 1

Hi Jasmin,

Thanx for the help from your end... But needed a little more.. Can u tell me the exact details of the properties tab of the render PDF form to be entered to accomplish the first part of my sloution. I m unable to understand what exactly needs to be entered in the various fields... have attached a screen shot of my Workbench for your reference... Thanx for the help buddy !!!

Avatar

Level 10

First you want to use the renderPDFForm from the Forms category, not Sample - Forms.

There's really only four parameters to set on the renderPDFForm:

1- Form URL: This is the url of the form template. (ex. /Forms/myForm.xdp)

2- inDocData: The data to merge with the form.

3- Content Root URI: This is the where the forms are stored (ex. repository:// if they are in the Adobe repository).

The form location should ultimately be Content Root URI + form url (repository:///Forms/myForm.xdp)

4- Rendered Form, the resulted PDF.

Jasmin

Avatar

Former Community Member

Hi Jasmin,

I have done word by word what you said above, but still get error.

com.adobe.livecycle.formsservice.exception.RenderFormException: xmldata: XML document structures must start and end within the same entity., cause: XML document structures must start and end within the same entity.

at com.adobe.formServer.Controller.tweakXMLData(Controller.java:324)

at com.adobe.formServer.Controller.render(Controller.java:115)

at com.adobe.formServer.FormServer.renderForm(FormServer.java:191)

at com.adobe.formServer.FormServer.renderForm(FormServer.java:257)

at com.adobe.formServer.docservice.FormsDocService.renderForm(FormsDocService.java:483)

at com.adobe.formServer.docservice.FormsDocService.renderForm(FormsDocService.java:421)

at com.adobe.formServer.docservice.FormsDocService.renderPDFForm(FormsDocService.java:119)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.java:118)

at com.adobe.idp.dsc.interceptor.impl.InvocationInterceptor.intercept(InvocationInterceptor.java:140)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor$1.doInTransaction(TransactionInterceptor.java:74)

at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.execute(EjbTransactionCMTAdapterBean.java:342)

at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doRequired(EjbTransactionCMTAdapterBean.java:259)

at sun.reflect.GeneratedMethodAccessor384.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jboss.invocation.Invocation.performCall(Invocation.java:345)

at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)

at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)

at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)

at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)

at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)

at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)

at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)

at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)

at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)

at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)

at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)

at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)

at org.jboss.ejb.Container.invoke(Container.java:873)

at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)

at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)

at $Proxy268.doRequired(Unknown Source)

at com.adobe.idp.dsc.transaction.impl.ejb.EjbTransactionProvider.execute(EjbTransactionProvider.java:129)

at com.adobe.idp.dsc.transaction.interceptor.TransactionInterceptor.intercept(TransactionInterceptor.java:72)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.interceptor.impl.InvocationStrategyInterceptor.intercept(InvocationStrategyInterceptor.java:55)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.interceptor.impl.InvalidStateInterceptor.intercept(InvalidStateInterceptor.java:37)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterceptor.java:132)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(JMXInterceptor.java:48)

at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:60)

at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:115)

at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:118)

at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:91)

at com.adobe.idp.dsc.provider.impl.vm.VMMessageDispatcher.doSend(VMMessageDispatcher.java:215)

at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispatcher.java:57)

at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)

at com.adobe.workflow.engine.PEUtil.invokeAction(PEUtil.java:724)

at com.adobe.workflow.engine.SynchronousBranch.handleInvokeAction(SynchronousBranch.java:466)

at com.adobe.workflow.engine.SynchronousBranch.execute(SynchronousBranch.java:863)

at com.adobe.workflow.engine.ProcessEngineBMTBean.continueBranchAtAction(ProcessEngineBMTBean.java:2773)

at com.adobe.workflow.engine.ProcessEngineBMTBean.asyncInvokeProcessCommand(ProcessEngineBMTBean.java:704)

at sun.reflect.GeneratedMethodAccessor1158.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jboss.invocation.Invocation.performCall(Invocation.java:345)

at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)

at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)

at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)

at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)

at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)

at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:158)

at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)

at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)

at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)

at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)

at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)

at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)

at org.jboss.ejb.Container.invoke(Container.java:873)

at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)

at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)

at $Proxy301.asyncInvokeProcessCommand(Unknown Source)

at com.adobe.workflow.engine.ProcessCommandControllerBean.doOnMessage(ProcessCommandControllerBean.java:156)

at com.adobe.workflow.engine.ProcessCommandControllerBean.onMessage(ProcessCommandControllerBean.java:99)

at sun.reflect.GeneratedMethodAccessor879.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.jboss.invocation.Invocation.performCall(Invocation.java:345)

at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:475)

at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)

at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:101)

at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)

at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)

at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)

at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)

at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)

at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)

at org.jboss.ejb.Container.invoke(Container.java:873)

at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1077)

at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1379)

at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)

at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:904)

at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:160)

at org.jboss.mq.SpySession.run(SpySession.java:333)

at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)

at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)

at java.lang.Thread.run(Thread.java:595)

Avatar

Level 10

You get the following error in the stack trace:

"xmldata: XML document structures must start and end within the same entity., cause: XML document structures must start and end within the same entity."

That's means your variable xmldata for the data parameter doesn't contain valid xml data.

Jasmin