Running Document Publisher in the Background
Publishing a Draft or Formal Document can take time. If you need to use Microsoft® Word for other work, is a nuisance when having to wait.
Users can run a batch file to create the documents either as a Draft and/or as a Formal document. The batch file can be used in a task while the user is not using their computer; for example at night or a weekend if many documents are being generated.
The command line needs to have all the options set the same as they would be through the UI (User Interface):
Formal Document Command line Options
The normal batch file command line options for just a draft document are:
Each of the following shows what the command line options for each Formal option in the User Interface:
All the above -fdoc options are requirements within the command line except -newversion. Only use the -newversion option, if a new version of the document is required.
The final command line to generate the DEMO Template will look like this: (NOTE: Options with more than a single word are required to be in quotes e.g. -fdoccomment “Published DEMO Template Using Batch File”)
"%CRADLEHOME%\bin\exe\windows\DocPub.exe" -login MANAGER,MANAGER,demo -file "DEMO Template" -location PROJECT -type DOCX -output "C:\Temp\DEMO Template.doc" -formal -fdocname "DEMO Template" -fdoctype REQUIREMENTS -fdoctitle "DEMO Template" -fdocissue 1 -fdocdate Jun -fdocref DEMO1 -fdocclass UNCLASSIFIED -fdoccomment "Published DEMO Template Using Batch File" –log
Any template that generates through Document Publisher can generate through a batch file.
As you can see in the command window below, 3 templates are being generated, a doc, a docx and a docm.
Once the documents are generated, they can be seen in WorkBench in the Project sidebar under the Formal Document sections:
Using parameters within a batch file
The great thing about using a command line batch file is that parameters can be set, as long as the template has parameters setup. This means you can run the same document many times but use different parameters for each run with a different document output name. For example if you used ?reqID within the Key or Identity you could output different Requirement Documents.