public class AsposePdfTemplateProcessor extends DocumentTemplateProcessor
TemplateProcessor
using the Aspose Document
.OUTPUT_TYPE_PDF, OUTPUT_TYPE_WORD, supportedContentType, templateResourceResolver
Constructor and Description |
---|
AsposePdfTemplateProcessor(TemplateResourceResolver templateResourceResolver) |
Modifier and Type | Method and Description |
---|---|
protected ContentItem |
createProcessorContentItem(ContentService contentService,
String outputDocumentName,
String outputDocumentType) |
protected byte[] |
getAsByteArray(com.aspose.pdf.Document doc) |
protected int |
getChoiceIndex(Object varValue,
com.aspose.pdf.ChoiceField choiceField) |
protected String |
getDocumentName(Map<String,Object> payload) |
protected String |
getFieldExpression(com.aspose.pdf.Field field) |
protected Iterable<com.aspose.pdf.Field> |
getSupportedFields(com.aspose.pdf.Form pdfForm) |
protected com.aspose.pdf.Document |
getTemplateDocument(TemplateHolder templateHolder) |
protected boolean |
isExpression(String fieldExpression) |
protected boolean |
isOptionField(com.aspose.pdf.Field field) |
protected byte[] |
processDocument(TemplateHolder templateHolder,
ExpressionManager expressionManager,
VariableContainer variableContainer) |
TemplateProcessingResult |
processTemplate(TemplateHolder templateHolder,
Map<String,Object> payload,
Map<String,Object> templateProcessingSettings)
Processes a template given by its definition which might have been loaded through the
TemplateRepositoryService . |
canRender, createContentItem, getContentInputStream, getContentService, getExpressionManager, getFromPayloadOrDefault, getVariableContainer, isContentItemGenerationEnabled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processTemplate
public AsposePdfTemplateProcessor(TemplateResourceResolver templateResourceResolver)
public TemplateProcessingResult processTemplate(TemplateHolder templateHolder, Map<String,Object> payload, Map<String,Object> templateProcessingSettings)
TemplateProcessor
TemplateRepositoryService
.
The payload is used for the placeholders within the template content and must be valid according the TemplateVariationModel.getParameters()
definition.templateHolder
- the template holder with template and template variation informationpayload
- the optional payload, if the template is using placeholders to render properly (must be valid according the parameter definition)protected byte[] processDocument(TemplateHolder templateHolder, ExpressionManager expressionManager, VariableContainer variableContainer) throws Exception
Exception
protected int getChoiceIndex(Object varValue, com.aspose.pdf.ChoiceField choiceField)
protected boolean isExpression(String fieldExpression)
protected String getFieldExpression(com.aspose.pdf.Field field)
protected Iterable<com.aspose.pdf.Field> getSupportedFields(com.aspose.pdf.Form pdfForm)
protected boolean isOptionField(com.aspose.pdf.Field field)
protected ContentItem createProcessorContentItem(ContentService contentService, String outputDocumentName, String outputDocumentType)
createProcessorContentItem
in class DocumentTemplateProcessor
protected byte[] getAsByteArray(com.aspose.pdf.Document doc) throws Exception
Exception
protected com.aspose.pdf.Document getTemplateDocument(TemplateHolder templateHolder)