Menu Request Demo

How to Print Out the Entire RED Documentation

Date:
20 December 2011
Author:
Raphael Klebanov

In order to be able to print out the complete RED documentation set, it is required to create a script that merges all the RED Documentation’s HTML files into one HTML file. The description is as follows:

  • Put the script_html_merge.bat script into RED documentation directory.
  • Double click on it to execute manually; it will create doc.html merged file. The execution of the script_html_merge.bat script can also be scheduled via RED Scheduler.
  • Download http://sourceforge.net/projects/pdfcreator/ PDF creator a free PDF printer for Windows. If desired, the other similar product can be used.
  • After the installation, it will create PDF Creator printer.
  • Open doc.html and print it to PDF Creator - it will create PDF file.
  • For PDF creation, you can use any other tool allowing printing into PDF or convert HTML into PDF; I used PDF Creator simply because it is free and it does a good job.
  • The code is two lines really, see attached code below

Note: Obviously, you can print out one doc at a time by Right Click on the doc and choose Print from dropdown menu

REM  *****************************************************************************

REM  Script Name    :    script_html_merge

REM  Description     :    Merges all the RED Documentation HTML files into one HTML file

REM  Generated by  :    WhereScape RED, manually

REM  Generated for :    WhereScape Customer

REM  Author              :    Raphael Klebanov

REM  *****************************************************************************

echo OFF

copy index.html doc.html

REM FOR %%G IN (dir /B w*.html) DO (copy doc.html+%%G d && copy d doc.html && del d)

FOR %%G IN (dir w*tech.html w*user.html ) DO (copy doc.html+%%G d  && copy d doc.html && del d)

REM this line will put the "tech" files first, then "user" files

REM  *****************************************************************************

REM  Notes

REM  *****************************************************************************

REM  1. "FOR %%G"  means for (each item)

REM  2. "/B" switch enabling the batch file to quit with a return code. "/B" option can be removed. I do not see any issues.

REM  3. DO (...&&...) means run the command following && only if the command preceding the symbol is successful.

REM  4. Small "d" is a temporary file used as a temporary copy.

REM  5. If the list of the files always contains the same files, then the remaining files can be added before or after w*, e.g. glossary.html

REM  6. To prevent cut off the images, configure the PDF Printer, e.g., use landscape instead of portrait.

REM  7. You can modify list of HTMLs that are processed within DO statement to include/exclude the doc files

Good luck!

CATEGORIES:

Comments 0

Leave a Comment

No comments.