Class Documents4jLocalServices

java.lang.Object
org.docx4j.documents4j.local.Documents4jLocalServices
All Implemented Interfaces:
Exporter<Documents4jConversionSettings>

public class Documents4jLocalServices extends Object implements Exporter<Documents4jConversionSettings>
Import/update/export docx/xlsx using Documents4j, with Microsoft Word running locally. You can use this to export to PDF, or to update your ToC. It can also import binary .doc or RTF. You can customise your conversion script by specifying one in docx4j.properties, under key: com.documents4j.conversion.msoffice.word_convert.vbs If you do not do that, the document4j's default script will be used (which doesn't update ToC). A sample override script (which updates ToC) is in docx4j-samples-resources. You'll need that script (or one like it) to update ToC.
Since:
8.2.0
Author:
jharrop
  • Field Details

  • Constructor Details

    • Documents4jLocalServices

      public Documents4jLocalServices()
      Configure the converter with default settings.
    • Documents4jLocalServices

      public Documents4jLocalServices(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, long timeout)
      Configures a worker pool for the converter. This worker pool implicitly sets a maximum number of conversions that are concurrently undertaken by the resulting converter. When a converter is requested to concurrently execute more conversions than 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.
      Parameters:
      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).
  • Method Details