Especially when Adobe Document Services are not running on the same server as the WD application you should pass the xdp template source as stream instead of passing it as URL. If you are passing it as URL you will receive a rendering error.
This can be done as follows:
String templateUrl = null;
ByteArrayOutputStream templateStream = null;
...
templateUrl = WDURLGenerator.getPublicResourcePath(otherPart, "My_InteractiveForm.xdp");
InputStream template = new FileInputStream(templateUrl);
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int nRead;
byte[] data = new byte[16384];
while ((nRead = template.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, nRead);
}
buffer.flush();
templateStream = buffer;
.....
IWDPDFDocumentHandler pdfDocumentHandler = WDPDFDocumentFactory.getDocumentHandler();
IWDPDFDocumentCreationContext pdfDocumentCreationContext = pdfDocumentHandler.getDocumentCreationContext();
.....
pdfDocumentCreationContext.setTemplate(templateStream);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
9 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |