source: trunk/Distribution/Scripts/FO2PS.CMD@ 3

Last change on this file since 3 was 2, checked in by jkacer, 18 years ago

Added all DocBook Framework stuff:

  • DocBook DTD
  • Transformation software FOP 0.20.5 and Saxon 6
  • XSL styles
  • Rexx scripts

Also added some WarpIN-related stuff for creation of WarpIN installation packages.
This state corresponds to version 1.0.0 from November 2005, just slightly modified to carry versioning information (Rexx scripts).

  • Property svn:keywords set to Author Revision Date HeadURL Id
File size: 3.0 KB
Line 
1/*
2 *************************************************************************************
3 *
4 * DocBook Framework for OS/2 and eComStation
5 * Convert Formatting Objects to PostScript
6 *
7 * More info on the web:
8 * http://www.kacer.biz/os2/docbook-framework/
9 *
10 * Author:
11 * Jarda Kacer <mailto:jarda@kacer.biz>
12 *
13 *************************************************************************************
14 *
15 * This script converts a FO file to a PS file.
16 *
17 *************************************************************************************
18 *
19 * $Author: jkacer $
20 * $Revision: 2 $
21 * $Date: 2007-09-05 20:07:46 +0000 (Wed, 05 Sep 2007) $
22 * $HeadURL: trunk/Distribution/Scripts/FO2PS.CMD $
23 *
24 *************************************************************************************
25 */
26
27OuterEnv = SetLocal()
28
29CALL RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
30CALL SysLoadFuncs
31
32Arguments = ARG(1)
33
34IF WORDS(Arguments) = 1
35 THEN DO
36 InputFile = WORD(Arguments, 1)
37 OutputFile = SUBSTR(InputFile, 1, LASTPOS(".", InputFile)-1) || ".PS"
38 CALL FOP "-fo " || InputFile || " -ps " || OutputFile
39 END
40 ELSE DO
41 CALL PrintUsage
42 END
43
44CALL EndLocal
45EXIT
46
47
48/***********************************************************************************************/
49/* Procedures and functions */
50/***********************************************************************************************/
51
52
53/*
54 * Sets an environment variable or appends a value to it.
55 */
56AddEnvironment: PROCEDURE
57PARSE ARG VarName, VarValue
58IF (Value(VarName, , "OS2ENVIRONMENT")="")
59 THEN CALL SetEnvironment VarName, VarValue
60 ELSE CALL Value VarName, GetEnvironment(VarName) || ";" || VarValue, "OS2ENVIRONMENT"
61RETURN
62
63
64/*
65 * Sets an environment variable, overwriting its previous value.
66 */
67SetEnvironment: PROCEDURE
68PARSE ARG VarName, VarValue
69CALL Value VarName, VarValue, "OS2ENVIRONMENT"
70RETURN
71
72
73/*
74 * Returns the value of an environment variable.
75 */
76GetEnvironment: PROCEDURE
77PARSE ARG VarName
78RETURN Value(VarName, , "OS2ENVIRONMENT")
79
80
81/*
82 * Returns the current script name.
83 */
84GetScriptName: PROCEDURE
85PARSE SOURCE Result
86RETURN WORD(Result, 3)
87
88
89/*
90 * Returns the current script path, without "\" at the end.
91 */
92GetScriptPath: PROCEDURE
93ScriptName = GetScriptName()
94RETURN SUBSTR(ScriptName, 1, LASTPOS("\", ScriptName)-1)
95
96
97/*
98 * Returns True if the given file exists.
99 */
100FileExists: PROCEDURE
101PARSE ARG FileName
102CALL SysFileTree FileName, Result
103RETURN Result.0 > 0
104
105
106/*
107 * Returns the current directory, without "\" at the end.
108 */
109GetCurrentDir: PROCEDURE
110RETURN DIRECTORY()
111
112
113/*
114 * Returns the parent directory of the directory passed as argument, without "\" at the end.
115 */
116GetParentDirectory: PROCEDURE
117PARSE ARG DirName
118RETURN SUBSTR(DirName, 1, LASTPOS("\", DirName)-1)
119
120
121/*
122 * Prints out a short help on how to call this script.
123 */
124PrintUsage: PROCEDURE
125SAY "DocBook Framework for OS/2, Formatting Objects --> PostScript"
126SAY "Usage: FO2PS <Formatting Objects>"
127RETURN
128
Note: See TracBrowser for help on using the repository browser.