Class AsposePdfTemplateProcessor
java.lang.Object
com.flowable.template.engine.impl.processor.DocumentTemplateProcessor
com.flowable.template.engine.impl.processor.AsposePdfTemplateProcessor
- All Implemented Interfaces:
TemplateProcessor
A
TemplateProcessor using the Aspose Document.-
Field Summary
FieldsFields inherited from class DocumentTemplateProcessor
OUTPUT_TYPE_PDF, OUTPUT_TYPE_WORD, supportedContentType, templateResourceResolver -
Constructor Summary
ConstructorsConstructorDescriptionAsposePdfTemplateProcessor(TemplateResourceResolver templateResourceResolver, AsposeTemplateProcessorSettings asposeTemplateProcessorSettings) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclearIncorrectCombFlagIfNecessary(com.aspose.pdf.TextBoxField textBoxField) Clears the comb flag on text fields where it must be ignored according to the PDF specification (ISO 32000-1, Table 228): the comb flag is only meaningful when aMaxLenis present and theMultilineflag is clear.protected byte[]getAsByteArray(com.aspose.pdf.Document doc, String pdfComplianceLevel) protected intgetChoiceIndex(Object varValue, com.aspose.pdf.ChoiceField choiceField) protected StringgetDocumentName(Map<String, Object> payload) protected StringgetFieldExpression(com.aspose.pdf.Field field) protected Iterable<com.aspose.pdf.Field> getSupportedFields(com.aspose.pdf.Form pdfForm) protected com.aspose.pdf.DocumentgetTemplateDocument(TemplateHolder templateHolder) protected booleanisExpression(String fieldExpression) protected booleanisOptionField(com.aspose.pdf.Field field) protected byte[]processDocument(TemplateHolder templateHolder, org.flowable.common.engine.impl.el.ExpressionManager expressionManager, org.flowable.common.engine.api.variable.VariableContainer variableContainer, String pdfComplianceLevel) processTemplate(TemplateHolder templateHolder, Map<String, Object> payload, Map<String, Object> templateProcessingSettings) Processes a template given by its definition which might have been loaded through theTemplateRepositoryService.Methods inherited from class DocumentTemplateProcessor
canRender, createContentItem, createProcessingResult, getContentInputStream, getContentService, getExpressionManager, getFromPayloadOrDefault, getVariableContainer, isContentItemGenerationEnabledMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TemplateProcessor
processTemplate
-
Field Details
-
asposeTemplateProcessorSettings
-
-
Constructor Details
-
AsposePdfTemplateProcessor
public AsposePdfTemplateProcessor(TemplateResourceResolver templateResourceResolver, AsposeTemplateProcessorSettings asposeTemplateProcessorSettings)
-
-
Method Details
-
getDocumentName
-
processTemplate
public TemplateProcessingResult processTemplate(TemplateHolder templateHolder, Map<String, Object> payload, Map<String, Object> templateProcessingSettings) Description copied from interface:TemplateProcessorProcesses a template given by its definition which might have been loaded through theTemplateRepositoryService. The payload is used for the placeholders within the template content and must be valid according theTemplateVariationModel.getParameters()definition.- Parameters:
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)- Returns:
- the template processing results
-
processDocument
protected byte[] processDocument(TemplateHolder templateHolder, org.flowable.common.engine.impl.el.ExpressionManager expressionManager, org.flowable.common.engine.api.variable.VariableContainer variableContainer, String pdfComplianceLevel) throws Exception - Throws:
Exception
-
clearIncorrectCombFlagIfNecessary
protected void clearIncorrectCombFlagIfNecessary(com.aspose.pdf.TextBoxField textBoxField) Clears the comb flag on text fields where it must be ignored according to the PDF specification (ISO 32000-1, Table 228): the comb flag is only meaningful when aMaxLenis present and theMultilineflag is clear. Some templates (e.g., authored by external tools) leave an incorrect comb flag on multi-line free-text fields. Spec-compliant renderers ignore it, but Aspose honors it regardless and spreads each character evenly across the full field width, producing stretched text (see JIRA FLW-6425). -
getChoiceIndex
-
isExpression
-
getFieldExpression
-
getSupportedFields
-
isOptionField
protected boolean isOptionField(com.aspose.pdf.Field field) -
getAsByteArray
-
getTemplateDocument
-