public class Documents4jLocalServices extends Object implements Exporter<Documents4jConversionSettings>
| Modifier and Type | Field and Description |
|---|---|
protected static Documents4jLocalServices |
instance |
| Constructor and Description |
|---|
Documents4jLocalServices()
Configure the converter with default settings.
|
Documents4jLocalServices(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
long timeout)
Configures a worker pool for the converter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
export(Documents4jConversionSettings conversionSettings,
OutputStream outputStream)
Export to outputStream as PDF.
|
void |
export(File officeFile,
OutputStream target,
com.documents4j.api.DocumentType documentType)
Export docx or xlsx file as PDF
|
void |
export(File officeFile,
OutputStream target,
com.documents4j.api.DocumentType documentType,
com.documents4j.api.DocumentType asDocumentType)
Export docx or xlsx file as specified com.documents4j.api.DocumentType
|
void |
export(OpcPackage pkg,
OutputStream outputStream)
Export WordprocessingMLPackage or SpreadsheetMLPackage as PDF
|
void |
export(OpcPackage pkg,
OutputStream outputStream,
com.documents4j.api.DocumentType asDocumentType)
Export WordprocessingMLPackage or SpreadsheetMLPackage as specified com.documents4j.api.DocumentType
|
static Exporter<Documents4jConversionSettings> |
getInstance() |
WordprocessingMLPackage |
importAsDocx(File officeFile)
Import as a docx from one of the other file types supported by Word.
|
void |
importAsDocx(File officeFile,
OutputStream target)
Import as a docx from one of the other file types supported by Word.
|
void |
updateDocx(File officeFile,
OutputStream target)
Run the script to update the docx (eg ToC).
|
WordprocessingMLPackage |
updateDocx(WordprocessingMLPackage pkg)
Run the script to update the docx (eg ToC).
|
void |
updateDocx(WordprocessingMLPackage pkg,
OutputStream outputStream)
Run the script to update the docx (eg ToC).
|
protected static Documents4jLocalServices instance
public Documents4jLocalServices()
public Documents4jLocalServices(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
long timeout)
maximumPoolSize,
it will queue excess conversions until capacities are available again.
If this number is set too low, the concurrent performance of the resulting converter will be weak compared to a higher number. If this number is set too high, the converter might overheat when accessing the underlying external resource (such as for example an external process or a HTTP connection). A remote converter that shares a conversion server with another converter might also starve these other remote converters.
corePoolSize - The core pool size of the worker pool.maximumPoolSize - The maximum pool size of the worker pool.keepAliveTime - The keep alive time of the worker pool.unit - The time unit of the specified keep alive time.timeout - The timeout for a network request (in ms).public static Exporter<Documents4jConversionSettings> getInstance()
public void export(Documents4jConversionSettings conversionSettings, OutputStream outputStream) throws Docx4JException
export in interface Exporter<Documents4jConversionSettings>Docx4JExceptionpublic void export(OpcPackage pkg, OutputStream outputStream) throws Docx4JException
pkg - outputStream - Docx4JExceptionpublic void export(OpcPackage pkg, OutputStream outputStream, com.documents4j.api.DocumentType asDocumentType) throws Docx4JException
pkg - outputStream - Docx4JExceptionpublic void export(File officeFile, OutputStream target, com.documents4j.api.DocumentType documentType) throws Docx4JException
officeFile - target - documentType - Docx4JExceptionpublic void export(File officeFile, OutputStream target, com.documents4j.api.DocumentType documentType, com.documents4j.api.DocumentType asDocumentType) throws Docx4JException
officeFile - target - documentType - asDocumentType - Docx4JExceptionpublic void updateDocx(WordprocessingMLPackage pkg, OutputStream outputStream) throws Docx4JException
pkg - outputStream - Docx4JExceptionpublic WordprocessingMLPackage updateDocx(WordprocessingMLPackage pkg) throws Docx4JException
pkg - Docx4JExceptionpublic void updateDocx(File officeFile, OutputStream target) throws Docx4JException
officeFile - target - documentType - Docx4JExceptionpublic void importAsDocx(File officeFile, OutputStream target) throws Docx4JException
officeFile - target - documentType - Docx4JExceptionpublic WordprocessingMLPackage importAsDocx(File officeFile) throws Docx4JException
officeFile - Docx4JExceptionCopyright © 2007-2022. All Rights Reserved.