Publishing

Publishing PageSeeder data to print, the Web or both

Task export-docx

This task can be used to convert a portable or processed PSML document to the Word docx format according to rules defined in the Microsoft Word docx Export Config.

For a list of the latest changes see github .

To use this Ant extension standalone outside PageSeeder you can download the pso-docx-ant-x.jar and pso-docx-core-x.jar files from bintray .

Definition

Minimal definition:

<export-docx src="[source]" />

 Full definition:

<export-docx
    src="[source]"
    dest="[destination]"
    working="[working-directory]"
    template="[template.dotx]"
    config="[config.xml]>
  <param
    name="[param name]"
    value="[param value]"/>
  ...
</export-docx>

Attributes

AttributeDescriptionRequired
srcPath to the source file to process. It should point to a '.psml' XML file.Yes
destPath to the destination file.
Will default to the name and location of the source with '.docx' extension if unspecified.
No
workingThe directory holding temporary files. Defaults to [java.io.tmpdir]/antdocx-[number].No
templatePath to .dotx template file.No
configPath to .xml config file.No

Parameters

The following @name and @value attributes are valid for <param> elements - all are optional.

NameValue
manual-coreWhether to take Word document properties from dotx template,  xml config or manual params (allowed values "Template|Configuration|Manual")
manual-creatorDocument Creator property
manual-revisionDocument Revision property (must be a number)
manual-createdDocument Created Date property (allowed values "Current Date|Pageseeder Document Creation Date")
manual-versionDocument Version property
manual-categoryDocument Category property
manual-titleDocument Title property
manual-subjectDocument Subject property
manual-descriptionDocument Description property

Usage

Invoking in Ant

This task is included by default in the PageSeeder publisher so <taskdef/>  is only required when using it outside the publisher.

<project ... xmlns:psd="antlib:org.pageseeder.docx.ant">

  <!-- only required for standalone -->
  <taskdef uri="antlib:org.pageseeder.docx.ant" 
      resource="org/pageseeder/docx/ant/antlib.xml" 
     classpath="pso-docx-ant-0.5.9.jar"/>

  <target ... >
    <!-- Invoke Task -->
    <psd:export-docx src="test.psml" dest="result.docx"/>
  </target>
</project>

Using a namespace is not required, but it is a good mechanism to know the origin of the task. The recommended namespace is 'psd'.

Standalone

It is designed to work as standalone. It is possible to invoke this task without being connected to PageSeeder.

Typically this task would be used in the context of a PageSeeder export. In that case, use the Task export and Task process to download the source PSML file.

How does it work?

This Ant task will:

  1. Load the config and template files.
  2. Transform the PSML into docx XML files.
  3. Zip up the XML files and associated images into the docx format.

Created on , last edited on