Step3: Rendering the Portfolio Object

With the portfolio object and all the required assets created, to render the portfolio, use the following API:
public PDFResponseType renderPortfolio(Portfolio portfolio, String dataXML)

This method takes in the portfolio object, with XML data, and returns a PDFResponseType object from which the Portfolio can be extracted and saved. The Data XML is used when a document is created out of a letter, which in turn references some Data dictionary elements. When the portfolio is rendered, the letter document is rendered with all the references to the DDEs resolved with the data from the XML.

Note: Presently, the letter document in the portfolio can be rendered interactively only. Flattening the letter and rendering is not available.
The following example shows how to render the final portfolio object and how to extract the portfolio file for saving to a local disk.
byte[] pdfDoc = null; 
PDFResponseType resp = portfolioRenderService.renderPortfolio(pf, xmlData); 
pdfDoc = resp.getFile().getDocument();

// Ethnio survey code removed