Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
bernd_speckmann
Contributor
0 Kudos

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);
Labels in this area