CREATE

LANSA Integrator

CREATE

The CREATE command reads the specified spool file and creates the PDF document.

Each spool file page will cause a new PDF page to be created. Use appropriate font size, leading and printer file options to fit the spool file page on a single PDF document page.

A spool file of 132 columns and 57 lines per page can fit on an A4 landscape page using a font size of 8 and leading of 8.5.

To accommodate the large number of keywords, a working list can be used to pass a list of keywords. Create a working list with two fields, the first field contains the keyword and the second field contains its value. Add an entry for each keyword required. Any keyword specified directly on the command will take precedence over a corresponding keyword entry in the working list. Refer to the examples to see how this works.

 

                                                         Required

 

 CREATE ------- DOCUMENT ----- file path ----------------------->

 

            >-- APPEND ------- *NO ----------------------------->

                               *YES

 

            >-- NAME --------- spool file name ----------------->

 

            >-- JOBNAME ------ spool file job name ------------->

 

            >-- JOBUSER ------ spool file job user ------------->

 

            >-- JOBNUMBER ---- spool file job number ----------->

 

                                                         Optional

 

            >-- NUMBER ------- 1 ------------------------------->

                               numeric value

 

            >-- PASSWORD ----- password ------------------------>

 

            >-- MASTER ------- master  ------------------------->

 

            >-- AUTHOR ------- author -------------------------->

 

            >-- TITLE -------- title --------------------------->

 

            >-- SUBJECT ------ subject ------------------------->

 

            >-- KEYWORDS ----- keywords ------------------------>

 

            >-- CREATOR ------ creator ------------------------->

 

            >-- ENCODING ----- *HPT ---------------------------->

                               *CSF

                               Cp37

                               Cp273

                               Cp277

                               Cp278

                               Cp280

                               Cp284

                               Cp285

                               Cp297

                               Cp420

                               Cp423

                               Cp424

                               Cp500

                               Cp838

                               Cp870

                               Cp871

                               Cp875

                               Cp880

                               Cp905

                               Cp930

                               Cp933

                               Cp935

                               Cp937

                               Cp939

                               Cp1025

                               Cp1026

                               Cp1112

                               Cp1122

                               Cp1123

                               Cp1130

                               Cp1140

                               Cp1141

                               Cp1142

                               Cp1143

                               Cp1144

                               Cp1145

                               Cp1146

                               Cp1147

                               Cp1148

                               Cp1149

                               Cp1153

                               Cp1154

                               Cp1155

                               Cp1156

                               Cp1157

                               Cp1158

                               Cp1160

                               Cp1164

                               Cp1371

                               Cp1388

                               Cp1399

                               Cp4971

                               Cp5026

                               Cp5035

 

            >-- FONT --------- *AUTO --------------------------->

                               *COURIER

                               *COURIER2

                               *COURIER3

                               *COURIER4

                               *MINCHO

                               *GOTHIC

                               *SIMSUN

                               *DFKAISB

                               *MINGLIU

                               *BATANG

                               *COURIERNEW

                               *MTSANSWT

                               *MTSANSWTIN

                               *MTSANSWTJ

                               *MTSANSWTJEA

                               *MTSANSWTK

                               *MTSANSWTKEA

                               *MTSANSWTME

                               *MTSANSWTTC

                               *MTSANSWTTCEA

                               *MTSANSWTTCTWEA

                               *THRNDWT

                               *THRNDWTJ

                               *THRNDWTK

                               *THRNDWTME

                               *THRNDWTSC

                               *THRNDWTTC

 

            >-- FONTSIZE ----- 10 ------------------------------>

                               numeric value

 

            >-- LEADING ------ (fontsize * 1.5) ---------------->

                              numeric value

 

            >-- PAGES -------- n,n-n --------------------------->

 

            >-- PAGETYPE ----- *TEXT --------------------------->

                               *IMAGE

 

            >-- PAGESIZE ----- *A4 ----------------------------->

                               *A0 -> *A10

                               *B0 -> *B5

                               *LETTER

                               *HALFLETTER

                               *LEDGER

                               *LEGAL

                               *NOTE

                               width, height

 

            >-- SCALING ------ n ------------------------------->

 

            >-- MARGIN ------- 36 points ----------------------->

                               left, right, top, bottom (points)

 

            >-- ORIENTATION -- *PORTRAIT -----------------------|

                               *LANDSCAPE 

 

Keywords

DOCUMENT

The name of the PDF file to be created or replaced.

For example:

<document name>.pdf creates a PDF file under the JSM instance root directory

documents/<document name>.pdf creates a PDF file under the JSM instance documents subdirectory

/<document name>.pdf creates a PDF file under the file system root directory.

APPEND

Append the created spooled file pages to the existing document. The default is *NO.

NAME

Spool file name. This must be a valid spool file name on the nominated IBM i output queue.

NUMBER

Spool file number. Default value of 1 is used if a value is not assigned. This must be a valid spool file number on the nominated IBM i output queue.

JOBNAME

Spool file job name. This must be a valid job name on the nominated IBM i output queue.

JOBUSER

Spool file job user. This must be a valid job user on the nominated IBM i output queue.

JOBNUMBER

Spool file job number. This must be a valid job number on the nominated IBM i output queue.

PASSWORD

A Password can be associated with the generated PDF file to restrict the opening of the document. This Password is case sensitive.

MASTER

If a Master Password is associated with the PDF document, this password must be supplied before you can set or change security settings. This Master Password is case sensitive.

AUTHOR

A text value to indicate the Author of the PDF document.

TITLE

A text string to be used as the title of the generated PDF document.

SUBJECT

A text string to indicate what the generated PDF document is about.

KEYWORDS

One or more words can be supplied to assist with searching for a PDF document. Keywords can be looked at as categories you can use to group similar or related documents.

CREATOR

A text value to indicate who created the PDF document.

ENCODING

The encoding is used to specify automatic host print transform conversion, automatic or specified copy to stream file conversion. The default encoding is *HPT. Use *CSF for automatic copy to stream file conversion or use a codepage value to specify the copy to stream file conversion ccsid.

FONT

The font used to draw the spool file text is fixed width Courier, Heisei Mincho or Heisei Kaku Gothic. The default font is *AUTO.

The following fonts are available by default.

*AUTO      Font: Determine font using selected encoding.
*COURIER   Font: Courier
*COURIER2  Font: Courier
*COURIER3  Font: Courier
*MINCHO    Heisei Mincho.
*GOTHIC    Heisei Kaku Gothic.

The other font support requires that i5/OS 5761SS1 Option 43 Additional Fonts licensed program to be installed.

FONTSIZE

The font size in points. The default setting is 10 point.

LEADING

Allows you to control the blank space before each line in the PDF document. The Default value is the (FONTSIZE * 1.5).

PAGES

A comma separated list of single page numbers and page ranges. The default is to select all pages.

PAGETYPE

This keyword specified the type of page generated. *IMAGE generates pages in TIFF G4 format. The SCALING keyword controls the percentage scaling of the image. The default value of *TEXT generates pages in text format. The FONT, FONTSIZE and LEADING keywords control the text output.

PAGESIZE

The page size for the generated PDF document. The default value is *A4.

Valid values are:

*A0 to *A10

*B0 to *B5

*LETTER

*HALFLETTER

*LEDGER

*LEGAL

*NOTE

width, height

SCALING

The percentage scaling to be applied to the generated page image. The default value is 18.

MARGIN

Page margins are the blank space around the edges of the page. The default value is 36 points (all sides) but you can set your own margins by nominating left, right, top and bottom values.

ORIENTATION

The default option is *PORTRAIT. Alternately you can nominate to generate as *LANDSCAPE.

Comments / Warnings

Ensure the user used to CONNECT to the host is authorized to work with the relevant spool files.

Examples

RDML

Particularly in RDML with its 256 field length restriction, it may be useful to use the SERVICE_LIST keyword to accommodate all the required keywords and values for the CREATE command.

Note: In this example the orientation will be *PORTRAIT as the command value will override any keywords provided in the SERVICE_LIST.

 

DEF_LIST NAME(#PDFLST) FIELDS((#PDFKEY *INP) (#PDFVALUE *INP)) TYPE(*WORKING)

 

DEFINE FIELD(#PDFKEY) TYPE(*CHAR) LENGTH(20)

DEFINE FIELD(#PDFVALUE) TYPE(*CHAR) LENGTH(50)

 

CHANGE FIELD(#PDFKEY) TO(AUTHOR)

CHANGE FIELD(#PDFVALUE) TO('LANSA PTY LTD')

ADD_ENTRY TO_LIST(#PDFLST)

 

CHANGE FIELD(#PDFKEY) TO(TITLE)

CHANGE FIELD(#PDFVALUE) TO('ANNUAL SALES REPORT')

ADD_ENTRY TO_LIST(#PDFLST)

 

CHANGE FIELD(#PDFKEY) TO(PAGESIZE)

CHANGE FIELD(#PDFVALUE) TO(*A5)

ADD_ENTRY TO_LIST(#PDFLST)

 

CHANGE FIELD(#PDFKEY) TO(ORIENTATION)

CHANGE FIELD(#PDFVALUE) TO(*LANDSCAPE)

ADD_ENTRY TO_LIST(#PDFLST)

 

CHANGE FIELD(#JSMCMD) TO('CREATE ORIENTATION(*PORTRAIT) FONTSIZE(8) LEADING(8.5) SERVICE_LIST(PDFKEY,PDFVALUE)')

 

USE BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG #PDFLST)

 

RDMLX

 

#jsmcommand := 'CREATE DOCUMENT(' + #JSMPDFdoc + ') NAME(' + #file name + ') NUMBER(' + #filenumber + ') JOBNAME(' + #jobname + ') JOBUSER(' + #jobuser + ') JOBNUMBER(' + #jobnumber + ') AUTHOR(' + #JSMUserid + ') FONTSIZE(8) LEADING(8.5)  ORIENTATION(*LANDSCAPE) SERVICE_LIST(PDFKEY,PDFVALUE)'

 

use builtin(jsmx_command) with_args(#jsmxhdle1 #jsmcommand) to_get(#jsmxsts #jsmxmsg #spoollst)