I have a short-lived process which renders PDF Form. This process takes two inputs. Form and Form Data. Form data can be PDF/XDP file and Form Data needs to be in XML format. The process works just fine within Workbench with either XDP or PDF file as input Form. When I invoke the process using Java API using a servlet, it says "The File is damaged and could not be repaired." This happens only if the input Form is a PDF file. If the input is in XDP format, I do not see any problem.
Any ideas ?
You don't need to Render PDF if your input form is in PDF format. Rather you could just import the given data into your supplied PDF. I hope this will solve your problem.
The problem was because in my code the space that I had allocated for reading the document object into an inputstream was too less. So some part of the output file was not being written to the browser.
But importing data into PDF seems to be a better approach if the input file is a PDF file.