Package de.xima.aspose.processor.core
Class AsposeWordConnector
- java.lang.Object
-
- de.xima.aspose.processor.core.AsposeWordConnector
-
- All Implemented Interfaces:
IAsposeConnector
public class AsposeWordConnector extends Object implements IAsposeConnector
Diese Klasse dient dazu ein Word-Dokument mit Formularinhalten zu befüllen und als PDF (andere, von Aspose unterstützte Ausgabetypen möglich) anzulegen.- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
LOG
-
Constructor Summary
Constructors Constructor Description AsposeWordConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDataAdapter
getDataAdapter()
com.aspose.words.Document
getDocument()
List<com.aspose.words.Node>
getElementsToDelete()
EvaluationMode
getEvaluationMode()
IReplacer
getReplacer()
Map<com.aspose.words.Row,Boolean>
getTablesToDelete()
void
initAspose(boolean useBackendParameter)
Diese Methode dient dazu, das Aspose-Framework zu konfigurieren.void
initAspose(boolean useBackendParameter, boolean useFullFieldName)
void
loadDocument(InputStream srcStream)
Loads a Word document from the given stream .void
loadDocument(String path)
Loads a Word document from the file system.void
processDocument(IDataAdapter fda, IReplacer replacer)
Processes the Word document, replacing all fields and functions.void
saveDocument(OutputStream output, int saveFormat)
Saves the current document to the given stream.void
saveDocument(String outputFile)
Saves the current document to the file system.void
setEvaluationMode(EvaluationMode evaluationMode)
Setzte den Modus unter dem Aspose laufen soll-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.aspose.processor.interfaces.IAsposeConnector
processDocument, processDocument, processDocument
-
-
-
-
Method Detail
-
getDataAdapter
public IDataAdapter getDataAdapter()
- Returns:
- The current data adapter being used to process the document.
-
getDocument
public com.aspose.words.Document getDocument()
- Returns:
- The current document being processed.
-
getElementsToDelete
public List<com.aspose.words.Node> getElementsToDelete()
-
getEvaluationMode
public EvaluationMode getEvaluationMode()
- Specified by:
getEvaluationMode
in interfaceIAsposeConnector
-
getReplacer
public IReplacer getReplacer()
- Returns:
- The current replacer used for the document.
-
initAspose
public void initAspose(boolean useBackendParameter) throws Exception
Description copied from interface:IAsposeConnector
Diese Methode dient dazu, das Aspose-Framework zu konfigurieren. Hierbei wird die Aspose-Lizenz gesetzt sowie die Verwendung von Backendparametern, anstelle von Elementnamen- Specified by:
initAspose
in interfaceIAsposeConnector
- Parameters:
useBackendParameter
- - Bool'scher Wert, der angibt ob Backendparameter verwendet werden- Throws:
Exception
- - Wenn die Lizenz ungültig ist oder nicht gefunden werden kann
-
initAspose
public void initAspose(boolean useBackendParameter, boolean useFullFieldName) throws Exception
- Specified by:
initAspose
in interfaceIAsposeConnector
- Parameters:
useBackendParameter
- - Bool'scher Wert, der angibt ob Backendparameter verwendet werdenuseFullFieldName
- - Bool'scher Wert, der angibt ob voll qualifizierte Name(z.B. elternelement.feld) als Original-Name verwendet werden soll oder nur der Feldname. Standardmäßig auf false gestellt.- Throws:
Exception
- - Wenn die Lizenz ungültig ist oder nicht gefunden werden kann- See Also:
IAsposeConnector.initAspose(boolean)
-
loadDocument
public void loadDocument(InputStream srcStream) throws Exception
Description copied from interface:IAsposeConnector
Loads a Word document from the given stream .- Specified by:
loadDocument
in interfaceIAsposeConnector
- Parameters:
srcStream
- Stream with the Word document.- Throws:
Exception
- When the stream could not be read.
-
loadDocument
public void loadDocument(String path) throws Exception
Description copied from interface:IAsposeConnector
Loads a Word document from the file system.- Specified by:
loadDocument
in interfaceIAsposeConnector
- Parameters:
path
- Path to the Word file.- Throws:
Exception
- When the file could not be read.
-
processDocument
public void processDocument(IDataAdapter fda, IReplacer replacer) throws Exception
Description copied from interface:IAsposeConnector
Processes the Word document, replacing all fields and functions.- Specified by:
processDocument
in interfaceIAsposeConnector
- Parameters:
fda
- Form data adapter with the data to use.replacer
- Optional replacer for replacing placeholders.- Throws:
Exception
- When the document could not be processed.
-
saveDocument
public void saveDocument(OutputStream output, int saveFormat) throws Exception
Description copied from interface:IAsposeConnector
Saves the current document to the given stream.- Specified by:
saveDocument
in interfaceIAsposeConnector
- Parameters:
output
- Output stream to which to write the document.saveFormat
- Format of the document, seeSaveFormat
.- Throws:
Exception
- When the file could not be written.
-
saveDocument
public void saveDocument(String outputFile) throws Exception
Description copied from interface:IAsposeConnector
Saves the current document to the file system.- Specified by:
saveDocument
in interfaceIAsposeConnector
- Parameters:
outputFile
- Path to the file to which to write the document.- Throws:
Exception
- When the file could not be written.
-
setEvaluationMode
public void setEvaluationMode(EvaluationMode evaluationMode)
Setzte den Modus unter dem Aspose laufen soll- Specified by:
setEvaluationMode
in interfaceIAsposeConnector
-
-