Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Error processing form submission

Avatar

Former Community Member
By the way sorry for my english.<br /><br />Im developing an application that uses forms. Im using XML + XDP to generate a pdf and then im using java api to process that form.<br /><br />When i try to use <br /><br />PDFContent content = new PDFContent();<br />FormsServiceClient formsClient = new FormsServiceClient(<br /> getServiceClientFactory());<br />Document formData = new Document(pdf);//pdf is a byte[]<br />RenderOptionsSpec processSpec = new RenderOptionsSpec();<br /> processSpec.setLocale("es_ES");<br /><br />FormsResult formOut = formsClient.processFormSubmission(formData, "CONTENT_TYPE=application/vnd.adobe.xdp+xml","", processSpec);<br /><br />I receive an error like this:<br /><br />com.adobe.livecycle.formsservice.exception.FormServerException: Parse error on document: DataSets error: Parse error on document: FSRequest error: Content in preface not allowed.<br /> at com.adobe.formServer.DataSets.<init>(DataSets.java:175)<br /> at com.adobe.formServer.FSRequest.getDataSets(FSRequest.java:1028)<br /> at com.adobe.formServer.RunTimeContext.commonInit(RunTimeContext.java:389)<br /> at com.adobe.formServer.RunTimeContext.<init>(RunTimeContext.java:322)<br /> at com.adobe.formServer.FormServer.doProcessFormSubmission(FormServer.java:362)<br /><br />I try to find this error in documentation but seems im first person with this problem. Any tip will be very apreciated.<br /><br />Thks in advance.
2 Replies

Avatar

Level 10
Does the 'pdf' variable contain the whole PDF or just the XDP+XML?



Jasmin

Avatar

Former Community Member
The pdf variable contains a byte array with pdf content. I will paste some code to explain.<br /><br />I have a form on my disk and i use FileUtils.readFileToByteArray(new File("<forms_name>")) to read it.<br /><br />Then i use FormsService with Java Api method<br /><br />======================================================================<br /><br />FormsServiceClient formsClient = new FormsServiceClient(<br /> getServiceClientFactory());<br />Document formData = new Document(pdf);<br /><br />RenderOptionsSpec processSpec = new RenderOptionsSpec();<br />processSpec.setLocale("es_ES");<br /><br /> FormsResult formOut = formsClient.processFormSubmission(formData, "CONTENT_TYPE=application/vnd.adobe.xdp+xml", "",<br /> processSpec);<br />======================================================================<br /><br />And when processFormSubmission is invoked throws exception <br /><br />com.adobe.livecycle.formsservice.exception.FormServerException: Parse error on document: DataSets error: Parse error on document: FSRequest error: Content in preface not allowed.<br /><br />Thank you.