Expand my Community achievements bar.

Error in converting PDFA by DocConverterServiceClient

Avatar

Level 1

Dear all,

I have a dynamic pdf created from LC Designer without password and saved with data filled by user.

Then I pass the form as input to DocConverterServiceClient.toPDFA and there is no problem to convert to PDFA format.

However if this original pdf is set with password in PDF Security under Form Properties of LC Designer,

I got following errors when I try to convert it to PDFA format :

com.adobe.livecycle.docconverter.client.ConversionException: ALC-CVT-S00-004: Error while converting document to conform to PDF/A: docConverter.pdf

  at com.adobe.livecycle.docconverter.DocConverterServiceImpl.toPDFA(DocConverterServiceImpl.java:350)

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

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

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

...

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

  at $Proxy306.doSupports(Unknown Source)

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

...

  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)

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

Caused by: com.adobe.internal.pdfm.util.PDFMPermissionException: PDFM_S00014: ANNOT_CREATE permission is required for this operation.

  at com.adobe.internal.pdfm.util.PDFMPermissionsManager.assertPermitted(PDFMPermissionsManager.java:106)

  at com.adobe.internal.pdfm.pdfa.PDFAService.toPDFA_2B(PDFAService.java:1027)

  at com.adobe.internal.pdfm.pdfa.PDFAService.toPDFA(PDFAService.java:444)

  at com.adobe.livecycle.docconverter.DocConverterServiceImpl.toPDFA(DocConverterServiceImpl.java:345)

  ... 91 more

I guess it is the security issue on the password, so I remove the password from pdf by calling

EncryptionServiceClient.removePDFPasswordSecurity which successfully remove the password from the pdf.

Then I input the password removed pdf to DocConverterServiceClient.toPDFA but now following errors occur :


java.lang.ClassCastException: com.adobe.internal.pdftoolkit.core.cos.CosNull cannot be cast to com.adobe.internal.pdftoolkit.core.cos.CosDictionary

  at com.adobe.internal.pdftoolkit.core.cos.CosArray.getCosDictionary(CosArray.java:559)

  at com.adobe.internal.pdftoolkit.services.pdfa2.processor.FileStructureProcessor.validateCryptFilter(FileStructureProcessor.java:1125)

  at com.adobe.internal.pdftoolkit.services.pdfa2.processor.FileStructureProcessor.validateStreamFilters(FileStructureProcessor.java:1020)

  at com.adobe.internal.pdftoolkit.services.pdfa2.processor.FileStructureProcessor.validateStreamObjects(FileStructureProcessor.java:820)

  at com.adobe.internal.pdftoolkit.services.pdfa2.processor.FileStructureProcessor.validate(FileStructureProcessor.java:225)

  at com.adobe.internal.pdftoolkit.services.pdfa2.processor.DocumentProcessor.process(DocumentProcessor.java:359)

  at com.adobe.internal.pdftoolkit.services.pdfa2.PDFA2Service.convert(PDFA2Service.java:133)

  at com.adobe.internal.pdfm.pdfa.PDFAService.toPDFA_2B(PDFAService.java:1285)

  at com.adobe.internal.pdfm.pdfa.PDFAService.toPDFA(PDFAService.java:444)

  at com.adobe.livecycle.docconverter.DocConverterServiceImpl.toPDFA(DocConverterServiceImpl.java:345)

  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:597)

  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.interceptor.impl.DocumentPassivationInterceptor.intercept(DocumentPassivationInterceptor.java:53)

  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:357)

  at com.adobe.idp.dsc.transaction.impl.ejb.adapter.EjbTransactionCMTAdapterBean.doSupports(EjbTransactionCMTAdapterBean.java:227)

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

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

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

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

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

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

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

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

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

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

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

  at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)

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

  at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:97)

  at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invoke(PreSecurityInterceptor.java:81)

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

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

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

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

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

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

  at $Proxy306.doSupports(Unknown Source)

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

  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:188)

  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:121)

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

  at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.invoke(AbstractMessageReceiver.java:329)

  at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkEndpoint.invokeCall(SoapSdkEndpoint.java:139)

  at com.adobe.idp.dsc.provider.impl.soap.axis.sdk.SoapSdkEndpoint.invoke(SoapSdkEndpoint.java:81)

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

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

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

  at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)

  at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)

  at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)

  at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

  at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

  at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

  at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)

  at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)

  at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)

  at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

  at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)

  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

  at com.adobe.idp.dsc.provider.impl.soap.axis.InvocationFilter.doFilter(InvocationFilter.java:43)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

  at com.adobe.idp.um.auth.filter.CSRFFilter.doFilter(CSRFFilter.java:86)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)

  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)

  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

  at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)

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

I am not sure if it is bug on the program or I miss out anything else,

I post the program as below, it is more or less the same as the sample API :

import java.util.*;

import java.io.File;

import java.io.FileInputStream;

import com.adobe.idp.Document;

import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;

import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;

import com.adobe.livecycle.docconverter.client.DocConverterServiceClient;

import com.adobe.livecycle.docconverter.client.PDFAConversionOptionSpec;

import com.adobe.livecycle.docconverter.client.PDFAConversionResult;

import com.adobe.livecycle.docconverter.client.PDFAConversionOptionSpec.Compliance;

public class Convert2PDFA {

 

    public static void main(String[] args) {

    try{

        //Set connection properties required to invoke LiveCycle ES4                             

        Properties connectionProps = new Properties();

        connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_SOAP_ENDPOINT, "http://localhost:8080");

        connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_SOAP_PROTOCOL);       

        connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "JBoss");

        connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");

        connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");

     

        //Create a ServiceClientFactory instance

        ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

     

        //Create a DocConverterServiceClient object

        DocConverterServiceClient docConverter = new DocConverterServiceClient(myFactory);

 

        //Reference a PDF document to convert to a PDF/A document

        FileInputStream myPDF = new FileInputStream("C:\\Adobe\\pwdRemoved_form.pdf");

        Document inDoc = new Document(myPDF);

     

        //Create a PDFAConversionOptionSpec object and set

        //tracking information

        PDFAConversionOptionSpec spec = new PDFAConversionOptionSpec();

        spec.setLogLevel("FINE");

        spec.setCompliance(Compliance.PDFA_2B);

     

        //Convert the PDF document to a PDF/A document

        PDFAConversionResult result =  docConverter.toPDFA(inDoc,spec);

     

        //Save the PDF/A file

        Document pdfADoc= result.getPDFADocument();

        File pdfAFile = new File("C:\\Adobe\\PDFA-2b_form.pdf");

        pdfADoc.copyToFile(pdfAFile);

  }

    catch (Exception e) {

        e.printStackTrace();

    }

  }

}

Grateful if somebody could offer help.

Rgds

0 Replies