Skip to content

Instantly share code, notes, and snippets.

@indaco
indaco / generatePDFfromXDP.java
Created May 14, 2010 10:08
Generate PDF from XDP
...
ByteArrayInputStream pdfInputStream = null;
try {
IWDPDFDocumentHandler pdfDocumentHandler = WDPDFDocumentFactory.getDocumentHandler();
IWDPDFDocumentCreationContext pdfDocCreationContext = pdfDocumentHandler.getDocumentCreationContext();
String templateUrl = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(),this.xdpSource);
InputStream template = new FileInputStream(templateUrl);
ByteArrayOutputStream templateStream = inputToOutputStream(template);