Docx4j Enterprise - trial edition
=================================

Version 17.0.2, built against docx4j 17.0.2.


YOUR TRIAL LICENCE
------------------

Install the licence before you run anything: copy plutext-trial-license.bin (in
this folder) into your project so that it is on your classpath -
src/main/resources in a Maven project, or WEB-INF/classes in a web application.
Keep the filename as it is.

Alternatively, leave it where it is and start your JVM with
-Dplutext.license=/full/path/to/plutext-trial-license.bin

Or copy it into a .plutext folder in your home directory.

Until the licence is installed, MergeDocx, MergePptx and the OLE helpers throw
com.plutext.enterprise.license.PlutextLicenseException.

When the trial expires, generated documents carry a notice and the product
keeps working - a trial never throws. Buying does not change the jars: you
install the licence file we send you, and nothing else. Its name will be
plutext-license-<your company>-subscription.bin (or -perpetual.bin); a licence
in your home .plutext folder takes precedence over a trial licence there.


QUICK START - A MERGE IN FIVE STEPS
-----------------------------------

From this zip to a merged docx on your screen. You need JDK 11+, Maven 3.6+,
and access to Maven Central (for docx4j and its dependencies).

STEP 1 - install the product jar into your local Maven repository. It is not
on any public repository:

  mvn install:install-file \
      -Dfile=MergeDocx/docx4j-Enterprise-MergeDocx-17.0.2.jar \
      -DgroupId=com.plutext \
      -DartifactId=docx4j-Enterprise-MergeDocx \
      -Dversion=17.0.2 \
      -Dpackaging=jar

STEP 2 - create a Maven project with this pom.xml:

  <project xmlns="http://maven.apache.org/POM/4.0.0">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>pej-trial</artifactId>
    <version>1.0</version>
    <properties>
      <maven.compiler.release>11</maven.compiler.release>
    </properties>
    <dependencies>
      <dependency>
        <groupId>com.plutext</groupId>
        <artifactId>docx4j-Enterprise-MergeDocx</artifactId>
        <version>17.0.2</version>
      </dependency>
      <dependency>
        <groupId>org.docx4j</groupId>
        <artifactId>docx4j-JAXB-ReferenceImpl</artifactId>
        <version>17.0.2</version>
      </dependency>
    </dependencies>
  </project>

A jar installed with install-file carries no pom, so Maven learns nothing about
its dependencies: the docx4j-JAXB-ReferenceImpl dependency is what pulls in
docx4j-core and the rest from Maven Central. Optionally add a logging
implementation (e.g. ch.qos.logback:logback-classic) to see the product's log
output; the quick start works without one.

STEP 3 - unpack the samples into it. The samples sources jar contains the
sample code and the sample documents it merges:

  cd <your project>
  mkdir -p src/main/java src/main/resources
  ( cd src/main/java && unzip <this zip>/MergeDocx/docx4j-Enterprise-MergeDocx-Samples-17.0.2-sources.jar )
  mv src/main/java/sample-docx src/main/resources/
  rm -rf src/main/java/META-INF src/main/java/module-info.java

Deleting module-info.java means everything runs from the classpath, which is
the simplest arrangement. (If you want the module path instead: keep it,
'requires com.plutext.mergedocx' only - the licence classes are inside that
automatic module; there is no separate licence module to require - and
uncomment the 'requires' line for the JAXB runtime you chose in step 2.)

STEP 4 - install the trial licence:

  cp <this zip>/plutext-trial-license.bin src/main/resources/

STEP 5 - run the licence-aware sample, from the project root (it resolves the
sample documents relative to the working directory):

  mvn compile exec:java \
      -Dexec.mainClass=com.plutext.samples.mergedocx.MergeWholeDocumentsWithLicenseManager

Or run that class from your IDE, with the project root as the working
directory.


WHAT YOU SHOULD SEE
-------------------

Two things to inspect:

1. The licence check, printed before the merge:

     Docx4j Enterprise licence: TRIAL_ACTIVE, expires <date>

   TRIAL_ACTIVE (not VALID) is the expected status for a trial licence, and
   the output it produces is clean - no notice. A trial licence has no
   licensee, so none is printed.

2. The merged document: OUT_MergeWholeDocumentsWithLicenseManager.docx in the
   project root. Open it in Word - it is IntegersOnly.docx, UN-Declaration.docx
   and SolarSystem.docx (from sample-docx/) merged into one document, styles,
   numbering and images intact.

The other classes in com.plutext.samples.mergedocx show more: block ranges,
headers and footers, incremental merge, altChunk processing. Run any class
with a main method the same way.


IF IT DOES NOT RUN
------------------

  PlutextLicenseException, "No Docx4j Enterprise licence was found"
      step 4 - the licence file is not on the classpath. The exception
      message lists every location that was tried.

  JAXBException, or a missing JAXB context, on the first document loaded
      step 2 - the docx4j-JAXB-ReferenceImpl dependency is missing (or you
      added two JAXB runtimes; use exactly one).

  Cannot resolve com.plutext:docx4j-Enterprise-MergeDocx
      step 1 - the product jar is not in your local repository.

  FileNotFoundException naming sample-docx/...
      step 3/5 - sample-docx must be under src/main/resources, and the
      working directory must be the project root.

Questions, or trial extensions: sales@plutext.com
