BLOG CATEGORIES



Create a two column PDF document

Knowing that there is no special element in RPE Pallet to create multiple column documents I was looking to find an alternative to be able to create a two column PDF document.

After a quick research I’ve seen that MS Office Word 2007/2010 provides the functionality to save a Word document in PDF format. Based on that and the fact that I could use a stylesheet to generate a two column document in Word my solution will contain the following steps:

  1. Extract the specific data contents (in my case I’ll extract all the requirements from a DOORS module).
  2. Use a styesheet to generate a two column document.
  3. Use a macro to save the Word output to PDF.

Prerequisites:

  • WORD 2007/2010
  • Rational Publishing Engine 1.1.1 or later
  • DOORS 9.3 or later

Step 1

Create a simple template to publish all the requirements from a DOORS module.

Figure 1: RPE Template

Step 2

Create a Word stylesheet to specific that the output will have a two column layout. To create a stylesheet in Word, go to File->New->Blank Document. In the newly created document go to the main menu and select the Page Layout entry. Then open the “Columns” combo list and select the “Two” columns value. Save the stylesheet with a suggestive name like: two_columns_stylesheet.doc.

Figure 2: Two column stylesheet

Step 3

Create a VB Macro to save the document in PDF format.
To create the macro, open the two_columns_stylesheet.doc and in the main menu select “View Macros”.

Figure 3: Create VB macro

Use the “Create” button to create a new macro. The VB script should be like this (FileName – the location where the PDF file will be saved):

Sub saveAsPdf()<br />        ActiveDocument.SaveAs FileName:="c:/RPE/doors/requirements/req.pdf", FileFormat:=wdFormatPDF<br />End Sub

Step 4

Open the Launcher perspective and configure the document specification. First you need to properly configure your DOORS data source and then you need to configure the Word output.
In the document specification view, select the Word output and then go to Properties view. You have to set the path, stylesheet and macro properties. See my configuration below:

Figure 4: Word output configuration

Now the document specification is configured and you can publish the document. After the document generation, automatically the Word file is open. The PDF file is saved in the directory specified in the macro. In my case: c:/RPE/doors/requirements/req.pdf.

PDF Output

“E voila” the two column PFD file containing all the requirements from a DOORS module:

Figure 5: Two column PDF output

One Comments to “Create a two column PDF document”

  1. Malar says:

    I couldn’t understand the things that u r specified in create-a-two-column-pdf-document, so pls give a assistant with clear detail.

Leave a Reply

(required)

(required)