- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hi,
Is there any way to write JAVA app that will validate PDFs through/with LC API ? I was traying with code:
...
ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
FormsServiceClient formsClient = new FormsServiceClient(myFactory);
FormsResult renderedForm = renderPDF(formName, xmlData, url, formsClient);
RenderOptionsSpec processSpec = new RenderOptionsSpec();
//processSpec.setValidationReporting(5);
processSpec.setLocale("pl_PL");
FormsResult formOut = formsClient.processFormSubmission(renderedForm.getOutputContent(),"CONTENT_TYPE=application/pdf","",processSpec);
System.out.println(formOut.getValidationErrorsList().toString());
...
//Rendering method
private static FormsResult renderPDF(String formName,String xmlData, String url, FormsServiceClient formsClient) throws RenderFormException, DSCException, UnsupportedEncodingException {
PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();
pdfFormRenderSpec.setCacheEnabled(new Boolean(false));
pdfFormRenderSpec.setXMLData(true);
pdfFormRenderSpec.setStandAlone(true);
pdfFormRenderSpec.setLinearizedPDF(true);
URLSpec urlSpec = new URLSpec();
urlSpec.setContentRootURI(url);
String credentialAlias = CREDENTIAL_ALIAS;
String credentialPassword = CREDENTIAL_PASSWORD;
ReaderExtensionSpec reOptions = new ReaderExtensionSpec();
reOptions.setReCredentialAlias(credentialAlias);
reOptions.setReCredentialPassword(credentialPassword);
reOptions.setReExpImp(true);
reOptions.setReFillIn(true);
reOptions.setReDigSig(true);
Document inputData = new Document(xmlData.getBytes("UTF-8"));
/*return renderedForm = formsClient.renderPDFForm(formName,inputData,pdfFormRenderSpec,urlSpec,null);*/
return formsClient.renderPDFFormWithUsageRights(formName,inputData,pdfFormRenderSpec,reOptions,urlSpec);
}
but in formOut.getValidationErrorsList() i still get:
[8/2/10 12:03:46:728 GMT+01:00] 0000002c SystemOut O --------------------Validation------------
[8/2/10 12:03:46:728 GMT+01:00] 0000002c SystemOut O <document state="active" senderVersion="3" persistent="false" senderPersistent="false" passivated="false" senderPassivated="false" deserialized="true" senderHostId="127.0.0.1/172.16.133.24/172.16.134.24" callbackId="0" senderCallbackId="0" callbackRef="null" isLocalizable="false" isTransactionBound="false" defaultDisposalTimeout="600" disposalTimeout="600" maxInlineSize="65536" defaultMaxInlineSize="65536" inlineSize="0" contentType="null" length="-1"><cacheId/><localBackendId/><globalBackendId/><senderLocalBackendId/><senderGlobalBackendId/><inline></inline><senderPullServantJndiName>adobe/idp/DocumentPullServant/adobews_anathNode01Cell_anathNode02_server1</senderPullServantJndiName><attributes/></document>
without any errors. I was looking around (google,forum and Adobe Develop Connection) but no luck
. Is it posible to make it that way ?
Ps.
It's my first post so (if i did something wrong
) be gentle. And ... sorry for my poor english
.
Views
Replies
Total Likes