Microsoft® Word® Documents To PDF Conversion
The Microsoft® Word® to PDF Action Task can be used to convert a Word® document into a PDF file that can be used in your PlanetPress Workflow process. It can also do a Mail Merge as it runs the task.
This plugin is only available with PlanetPress Production (and not with PlanetPress Office or PlanetPress Watch).
Microsoft® Word® needs to be installed for this task to be functional and to test the connection.
Input
A compatible Microsoft Word Document (see notes).
Processing
The Word document is converted into a PDF file. If a Mail Merge is made, the mail merge is done in the document before the document is converted into a PDF file. The conversion is done through the use of a printer queue - the document is printed to this queue and the print job is converted to PDF. This is the same technique used in the WinQueue Input when generating PDF files.
Output
One of:
- By default, a PDF file accompanied with basic PDF metadata. The Metadata contains one "Document" level, and one data page (and page) level for each PDF page generated by the document. When Mail Merge is not selected, this is the only available choice.
In current versions, the Objectif Lune Printer Driver will naturally add a margin to the PDF generated by this task. While this will be fixed in future versions, if your PDF is full bleed you will not get the desired results using this option.
- A DOC (Word Document) file which is the result of the mail merge. This output is only available when doing a mail merge.
Task Properties
General tab
- Microsoft Word Document: Enter a Microsoft® Word® document or template, or click the browse button to navigate to the location of the document. The supported extensions are: *.doc, *.docx, *.dot and *.dotx.
- Perform Mail Merge: Check when providing a Microsoft® Word® document or template configured for mail merge.
- Use settings specified in document: Selected to instruct the task to use the connection string and SQL statements stored in the DOC file. There is no guarantee that the database, connection string or statement are still valid, especially if the DOC file was moved or sent to someone else.
- Use custom settings: Override the mail merge settings in the Microsoft® Word® document and lets you specify your own.
- Connection String: The connection string to any ODBC database supported by PlanetPress Suite. You can use the Browse button to open an existing File DSN, or use the Database Button to open the ODBC connection interface.
- SQL Statement: An SQL statement that is understood by the database you are using and that will return a series of records that the Microsoft® Word® template is expecting. Note that no validation is made on SQL statements except if they are for Microsoft Access and Excel data files. You can use the Test Connection button to test the SQL and connection string.
- Test connection: Checks if the Connection String and SQL Statement are valid, and if the resulting recordset is understood by the Microsoft® Word® document. This is optional, though highly recommended.
- Output Type:
- .PDF File (with metadata): The result will be a PDF file with the number of pages generated by the combination of the template and recordset. Metadata is also included that complement the PDF.
- .DOC file: The result is a Microsoft® Word® document in .doc format. Note that this format is not supported by PlanetPress Suite as a data file or job file, so this option is only useful if you are simply planning to save the Word document in a specific location.
On Error Tab
By default, any action task, branch, splitter or condition that generates an error will simply be ignored, and the task just under it (not within a branch) will be given control of the job file without any modification. Any initial input task that generates an error will stop the process from running as a whole, and output tasks will not generate output. The On Error tab can be used to overwrite the default behaviors.
- Send to Process: Check this option to send the job file to an error management process.
- Error Process drop-down: Enabled only when the Send to Process option is checked. Lists any process of which the initial input task is the Input Error Bin task.
- Action Group: This group is disabled in the initial input tasks and defaults to Stop Process. In all other tasks where the On Error tab is present, the following options are available:
- Ignore: The task is ignored as if it did not exist, and the job file is passed on to the next task in the process.
- Stop Branch: If the task is in a branch of the process, the branch is stopped and the job file is returned to the process after the branch. The branch will not produce any output.
- Stop Process: The process is stopped and no more processing is done. No further output is produced.
- Log Message: Check this option to enable logging a custom error message in the PlanetPress Suite Workflow Tools' log file.
- Message: Enabled only when the Log Message option is checked. Enter a message that will be logged in the PlanetPress Suite Workflow Tools' log file. You can use any variables available in PlanetPress Workflow to customize the message.
- Store the message in variable: Select in which jobinfo, local or global variable you want to store the message content.
- ID: Enter an error ID. This ID will be visible in the Windows Event Viewer. However, the ID is not visible in the PlanetPress Suite Workflow Tools' log file.
- Store the ID in variable: Select in which jobinfo, local or global variable you want to store the error ID.
- Reset to defaults: Resets all options in this tab to their default values.
If storing the message or ID, if they are store in a jobinfo they will be available in any error handling process where errors are being forwarded. In all cases, if your process continues after the error, the contents of the variables selected in this window will be available for the rest of your process, or whenever they are overwritten.
Common Errors
Though some error messages are specific to a task in particular, others may apply to any and all tasks because they are related more to the system than to PlanetPress itself. Some examples would be W3813, W3830, W3991, W4005. These correspond to issues such as not having any space to write files, permission errors on folders or files, etc.
Comments Tab
The Comments tab, added in PlanetPress Suite 7.5, is common to all tasks. It contains a single text area (Task comments) that lets you write comments about the task. These comments are saved when the dialog is closed with the OK button, and are displayed in The Task Comments Pane.
Notes
- Microsoft Word must be installed on PlanetPress Workflow system.
- Microsoft Word must not be currently opened when the automation task runs.
- Microsoft Word 2003 and up are supported.
- The task uses a printer queue set with the “PlanetPress Word to PDF Printer” driver, which is created and set by default on-the-fly the first time a Microsoft® Word® Document to PDF Action Task is run. This printer cannot be shared on the network in order to avoid confusion from network users, however it is shared between all Microsoft® Word® Document to PDF action tasks on the same system.
- While debugging this task, the printer shows the message that the document can not be printed. This message is normal and will not appear when running a live configuration.
- If using a Microsoft® database such as Access® or Excel®, each software must be installed in the same version. For example, using Microsoft® Word® 2007 with a Microsoft® Access® 2003 database will cause the task to fail.
- If the database path is specified in the Microsoft® Word® document, the mail merge has to be performed with the settings specified in the document, otherwise the database path provided in the task is ignored and can cause different conflicts. To use custom settings, the Microsoft® Word® document should contain only mail merge fields with no database path entered. The Microsoft® Word® to PDF Action task allows specifying the path of the database and the query to use. The Use custom settings option is very usefully for using different databases and queries in a single process.
- If the database is the same for 2 processes, one of two processes aborts. Each process has to use different databases, or no more than one process with a Microsoft® Word® to PDF task.