To setup an embed definition you select this in InterForm400:
5. Work with Auto Forms Control
7. PDF embedding definitions
Here you can create an embed definition with F6=Create and then setup the definition:
Work with embedding definitions EMB300D
Position to . . . . . . Embedding definition
Type options, press Enter. 2=Change 3=Copy 4=Delete 5=Display
Embedding Opt definition Description DEMO DEMO 2 DEMO1 DEMO1: Header info from page 1=> Terms of delivery DEMO2 DEMO2 STATEMENT Include invoices in statement
End F3=Exit F5=Refresh F6=Create F12=Cancel
|
When editing (or creating a new definition) you are prompted for the open action:
Change embedding definition EMB305D
Embedding definition . . : DEMO1 Description . . . . . . . DEMO1: Header info from page 1=> Terms of delivery Open action . . . . . . . 0 0 = Do not show attachment window 1 = Show attachment window
F3=Exit F12=Cancel
|
The open action sets if you want to display a list of the embedded files when the PDF file is opened:
Option ‘0 = Do not show attachment window’ opens the file like this:
Option ‘1 = Show attachment window’ displays the list of embedded files like this:
After hitting Enter you can now work with the file types of the current embed definition and create new ones with F6=Create:
Change embedding definition - file types EMB310D
Embedding definition . . : DEMO1 Description . . . . . . : DEMO1: Header info from page 1=> Terms of delivery Type options, press Enter. 2=Change 3=Copy 4=Delete 5=Display Opt File type Description TERMS Terms of delivery
F3=Exit F6=Create F12=Cancel
|
You can define multiple file types inside the same embed definition. The file type setup is described below.
Within an embed definition you can define one or multiple file types:
Change embedding definition - file types EMB310D
Embedding definition . . : DEMO1 Description . . . . . . : DEMO1: Header info from page 1=> Terms of delivery Type options, press Enter. 2=Change 3=Copy 4=Delete 5=Display Opt File type Description TERMS Terms of delivery
F3=Exit F6=Create F12=Cancel
|
After creating a file type (defining a name and description of the document type to embed) you will see this screen:
Change embedding definition - file type details EMB320D Embedding . . .: DEMO1 DEMO1: Header info from page 1=> Terms of delivery File type . . .: TERMS Terms of delivery
Select one of the following options:
1. Descriptions of file type to be embedded 2. Embedding model 3. Icon 4. Variables 5. Path to file(s) to be embedded 6. Page layout input spooled files 7. Variables in head page 1 8. Detail line layout 9. Variables in detail lines 10. User exit program to find variable(s)
Option:
F3=Exit F12=Cancel
|
Each option is described below:
Here you define an internal description of the type of file/document, that you are embedding:
Change embedding definition - file type details EMB320D Embedding . . .: DEMO1 DEMO1: Header info from page 1=> Terms of delivery File type . . .: TERMS Terms of delivery
Description . . . . . . Terms of delivery
F3=Exit F12=Cancel
|
This is not used in the actual output.
With this option you define how InterForm400 should identify the file(s) to be embedded:
Change embedding definition - file type details EMB320D Embedding . . .: DEMO1 DEMO1: Header info from page 1=> Terms of delivery File type . . .: TERMS Terms of delivery
Embedding model . . . 2 1 = Embed a specific file 2 = Embed a file based on variables from page 1 3 = Embed a number of files based on variables in head of page 1 and variables from detail lines.
F3=Exit F12=Cancel
|
You can chose to embed one fixed file, a file identified by header information (in a fixed position and line) found only on page 1 of the spooled file or multiple files identified by information found in both the header of page 1 and detail lines.
In this example we want to insert a file containing terms of delivery, that is depending on the customer type/id. In this example there is only one document per spooled file, so we can use option 2.
With this option you define what icon to insert in the main PDF file to open the embedded file(s) and where to place the icon. The screen has different contents depending on the embedding model selected above. Here the embedding model is 2:
Change embedding definition - file type details EMB320D Embedding . . .: DEMO1 DEMO1: Header info from page 1=> Terms of delivery File type . . .: TERMS Terms of delivery
Icon type . . . . . . . . 1 1 = Paper Clip 2 = Push Pin 3 = Tag 4 = Graph 5 = Blue Underline 6 = Image from /APF3812home/Icons (JPG)
Where to place icon Page code . . . . . . . . 1 1 = First page 2 = All pages 3 = Last page Location on page From top . . . . . . . . 0,180 From left . . . . . . . . 2,180 Rotation . . . . . . . . 000 Icon size Height . . . . . . . . . 0,060 Width . . . . . . . . . . 0,060
F3=Slut F12=Cancel
|
The icon type identifies the image to use for the link to the embedded file. Types 1-4 are shown below:
1= Paper Clip:
2 = Push Pin:
3 = Tag:
4 = Graph:
Icon type 5 sets the link to be a blue underline and with type 6 you can use your own image - which can even by dynamically selected with one or more variables. The image file name for type 6 is set via option 5. Path to file(s) to be embedded.
Take care not to state an icon height, that is too large for detail lines. Especially for the underline you should consider a height around 0,020 to avoid overlapping links.
The placement and size is written in inches and pels.
You can define up to 9 variables, which can be retrieved from the spooled file and used for identifying:
1. The path and file name of the file(s) to be embedded.
2. The name of the embedded file as it appears in the main PDF file.
3. The name of the image, which is to be used as the icon in the main PDF file.
The variables are changed via this list:
Change embedding definition - variables EMB330D Embedding . . .: DEMO1 DEMO1: Header info from page 1=> Terms of delivery File type . . .: TERMS Terms of delivery
Type options, press Enter. 2=Change 4=Delete 5=Display Opt Variable Status Description Length Trim Placement *V1 Defined Customer type 4 *NO Head *V2 Not defined *V3 Not defined *V4 Not defined *V5 Not defined *V6 Not defined *V7 Not defined *V8 Not defined *V9 Not defined
F3=Exit F12=Cancel
|
To set or change a variable you select option 2=Change:
Change embedding definition - variables EMB330D Embedding . . .: DEMO1 DEMO1: Header info from page 1=> Terms of delivery File type . . .: TERMS Terms of delivery
Variable . . . . . . . : *V1 Description . . . . . . Customer type Variable length . . . . 4 (1 - 30) Trim variable . . . . . *NO *RIGHT, *YES, *NO Placement of variable . 1 1 = In head 2 = In detail line 3 = UserExit
F3=Exit F12=Cancel
|
With Trim variable you decide if you want to remove any trailing (*RIGHT) or both leading and trailing (*YES) blanks from the variable before using it.
Placement of variable sets the type of variable. It can either be found in a fixed position in the header or in the detail lines - or the variable can be set via a user exit program.
If you chose option 3=UserExit a user program will be called to set the value of the variable. The user program is defined in option 10. User exit program to find variable(s).
Here you state the path and file name to embed and what it should be named when it is embedded:
Change embedding definition - file type details EMB320D Embedding . . .: DEMO1 DEMO1: Header info from page 1=> Terms of delivery File type . . .: TERMS Terms of delivery
Path to file(s) /apf3812home/work/*V1.pdf
Name of the embedded file inside the PDF-file Terms of delivery.pdf
Image from /APF3812home/Icons to be used as Icon
F3=Slut F12=Cancel
|
This sets the file(s) to include of the given type. If you want to embed other file types you simply create another file type for the current embedding definition.
The bottom field: Image from /APF3812home/Icons... is shown only if you have set the icon type to be ‘6 = Image from /APF3812home/Icons’ in option 3. Icon. JPG files can be used as icons.
This option is only shown if you have set the embedding model to 3 (specifying that you want to use data from the detail lines for the embedding) in option 2. Embedding model.
Here you state which lines in the spooled file, that can be considered detail lines:
Change embedding definition - file type details EMB320D Embedding . . .: DEMO3 DEMO3: Embed picture of part in detail lines File type . . .: PART_IMG Image of part number
Line number interval detail lines
First page . . . . . . . 22 - 66 Following pages . . . . 12 - 66
Type of detail lines . . . 1 1 = A logical line is one physical line, and all detail lines have the same format. 2 = Other
F3=Slut F12=Cancel
|
Above we have defined the setup for a situation, where the header on page 1 is larger than on the subsequent pages, so the detail lines start at line 22 on page 1 and line 12 on the other pages.
The type of detail lines sets the layout of the detail lines. If all detail lines are simular, then you simply set the type to be 1, but if there are multiple layouts of the detail lines, then you set the type to 2. Setting the type to 2 will open another option on the file type menu: 8. Detail line layout.
If you have defined any variables, that are placed in the header of the spooled file, then they are listed when this option is selected. Here you should set the line and positions in the spooled file from where the contents of this variable can be found:
Change embedding definition - variables in head EMB335D Embedding . . .: DEMO1 DEMO1: Header info from page 1=> Terms of delivery File type . . .: TERMS Terms of delivery
Type options, press Enter. 2=Change 4=Delete 5=Display Opt Variable Description Lineno Position *V1 Customer type 13 57 *V2
F3=Exit F12=Cancel
|
Select option 2=Change to set the variable:
Change embedding definition - variables in head EMB335D Embedding . . .: DEMO1 DEMO1: Header info from page 1=> Terms of delivery File type . . .: TERMS Terms of delivery
Variable . . . . . . . : *V1 Description . . . . . : Customer type
Line number . . . . . . 13 (1-255) Left position . . . . . 57 (1-378)
F3=Exit F12=Cancel
|
The length of the variable is defined in option 4. Variables, so here you just state the start position.
This option is only available if you have set the detail lines to be type 2=Other in option 6. Page layout input spooled files.
With this option you can identify various detail line types. You can set multiple line types numbered by a sequence number. InterForm400 will for each detail spooled file line in the interval stated in option 6. Page layout input spooled files go through this list in numeric order.
Below we have set a line type, that checks if positions 1-8 are all numeric (or blank). If that is the case, then the variable(s) will be retrieved and a link inserted:
Change embedding definition - detail line layout EMB350D Embedding . . .: DEMO3 DEMO3: Embed picture of part in detail lines File type . . .: PART_IMG Image of part number
0001 Part number line
Seqnbr. 1,0 Description . . . . . . . . Part number line Compare positions . . . . . 1 - 8 1 - 378 Compare code . . . . . . . A = > < N A U Compare value . . . . . . . 0123456789 Number of physical lines . *VAR 1 - 99, *VAR Links in this file type . . *YES *YES, *NO
F3=Exit F11=Delete F12=Cancel
|
If you want to make sure, that some lines are not considered for variables and links, then you can insert a line type prior to this line to identify the lines, that should not be used:
Change embedding definition - detail line layout EMB350D Embedding . . .: DEMO3 DEMO3: Embed picture of part in detail lines File type . . .: PART_IMG Image of part number
0002 Ignore these lines 0003 Part number line
Seqnbr. 2,0 Description . . . . . . . . Ignore these lines Compare positions . . . . . 1 - 8 1 - 378 Compare code . . . . . . . U = > < N A U Compare value . . . . . . . 0123456789 Number of physical lines . 01 1 - 99, *VAR Links in this file type . . *NO *YES, *NO
F3=Exit F11=Delete F12=Cancel
|
The conditions (and *VAR) are functioning in the same manner as for calling conditioned overlays (also referred to as ‘until another is true’ for the conditioned overlays) i.e. transfer spooled file lines until another condition is true.
The defined variables will only appear here if you in option 4. Variables have defined them to be placed in detail lines:
Change embedding definition - variables in detail lines EMB340D Embedding . . .: DEMO3 DEMO3: Embed picture of part in detail lines File type . . .: PART_IMG Image of part number
Type options, press Enter. 2=Change 5=Display Opt Variable Description Lineno Position *V1 Part number 1 1
F3=Exit F12=Cancel
|
Each variable is set like this:
Change embedding definition - variables in detail lines EMB340D Embedding . . .: DEMO3 DEMO3: Embed picture of part in detail lines File type . . .: PART_IMG Image of part number
Variable . . . . . . . . . . : *V1 Description . . . . . . . . : Part number
Left position . . . . . . . . 1 (1-378) Control placement of icon . . 1 1=Yes
To change control of placement icon for this variable to *NO, change another variable to *YES.
F3=Exit F12=Cancel
|
The Left position is the start position in the spooled file from where to grab the value of the variable.
If Control placement of icon is set to 1 (=*YES), then the position of the spooled file text retrieved for this variable will be the basis for the position of the link in the main PDF file. This even takes into account if you use a remap or other design elements to reposition the spooled file text. The spooled file data for the detail variable must be remapped if you are using it to control the placement of the icon.
With this option you set the program to be called, if you want to set the value for one or more variables via a user program.
This user program will get the values of all the other variables making it possible to e.g. look up in a data base and return the found value(s). A demo source for such a program is included in the source file APF3812/APISRC in member EMBEXIT. Remember not to place the program object in the APF3812 library and that the owner of the program must be QSECPFR.