jspdf-dynamo 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +93 -0
  3. package/dist/index.cjs +2175 -0
  4. package/dist/index.d.cts +370 -0
  5. package/dist/index.d.ts +370 -0
  6. package/dist/index.js +2145 -0
  7. package/documentation/1. Introduction/Introduction.txt +91 -0
  8. package/documentation/2. JsPdfDynamo/JsPdfDynamo.txt +6 -0
  9. package/documentation/2. JsPdfDynamo/constructor.txt +31 -0
  10. package/documentation/2. JsPdfDynamo/getVariable.txt +29 -0
  11. package/documentation/2. JsPdfDynamo/prepareWrappedString.txt +28 -0
  12. package/documentation/2. JsPdfDynamo/processCommands.txt +27 -0
  13. package/documentation/2. JsPdfDynamo/toBlob.txt +19 -0
  14. package/documentation/2. JsPdfDynamo/toBlobUrl.txt +36 -0
  15. package/documentation/3. Variables/Introduction.txt +36 -0
  16. package/documentation/3. Variables/SystemMaintained.txt +190 -0
  17. package/documentation/4. Commands/AddBookmark.txt +47 -0
  18. package/documentation/4. Commands/AddImageFromFile.txt +59 -0
  19. package/documentation/4. Commands/AddImageFromUrl.txt +63 -0
  20. package/documentation/4. Commands/AddPage.txt +40 -0
  21. package/documentation/4. Commands/CheckPage.txt +52 -0
  22. package/documentation/4. Commands/CopyVar.txt +52 -0
  23. package/documentation/4. Commands/Do.txt +40 -0
  24. package/documentation/4. Commands/DoRepeat.txt +51 -0
  25. package/documentation/4. Commands/DrawBox.txt +67 -0
  26. package/documentation/4. Commands/DrawDebugGrid.txt +41 -0
  27. package/documentation/4. Commands/DrawImage.txt +92 -0
  28. package/documentation/4. Commands/DrawLine.txt +62 -0
  29. package/documentation/4. Commands/DrawText.txt +61 -0
  30. package/documentation/4. Commands/DrawTextBox.txt +99 -0
  31. package/documentation/4. Commands/DrawTextWrapped.txt +65 -0
  32. package/documentation/4. Commands/ForEachPage.txt +44 -0
  33. package/documentation/4. Commands/GetEnvVar.txt +56 -0
  34. package/documentation/4. Commands/IfBlank.txt +63 -0
  35. package/documentation/4. Commands/IfGt.txt +58 -0
  36. package/documentation/4. Commands/IfNotBlank.txt +60 -0
  37. package/documentation/4. Commands/IncCurrentX.txt +52 -0
  38. package/documentation/4. Commands/IncCurrentY.txt +50 -0
  39. package/documentation/4. Commands/IncVar.txt +73 -0
  40. package/documentation/4. Commands/Include.txt +44 -0
  41. package/documentation/4. Commands/MultVar.txt +70 -0
  42. package/documentation/4. Commands/SetCurrentX.txt +37 -0
  43. package/documentation/4. Commands/SetCurrentY.txt +37 -0
  44. package/documentation/4. Commands/SetDocumentInfo.txt +35 -0
  45. package/documentation/4. Commands/SetFillColour.txt +58 -0
  46. package/documentation/4. Commands/SetFontName.txt +4 -0
  47. package/documentation/4. Commands/SetFontSize.txt +22 -0
  48. package/documentation/4. Commands/SetFontStyle.txt +55 -0
  49. package/documentation/4. Commands/SetLineColour.txt +58 -0
  50. package/documentation/4. Commands/SetLineWidth.txt +42 -0
  51. package/documentation/4. Commands/SetMargin.txt +69 -0
  52. package/documentation/4. Commands/SetPageOrientation.txt +42 -0
  53. package/documentation/4. Commands/SetVar.txt +69 -0
  54. package/documentation/5. Other Definitions/jsPdfOptions.txt +56 -0
  55. package/documentation/5. Other Definitions/logger.txt +35 -0
  56. package/documentation/5. Other Definitions/pageSizes.txt +41 -0
  57. package/documentation/6. Other/PossibleEnhancements.txt +63 -0
  58. package/documentation/6. Other/To Be Documented.txt +50 -0
  59. package/documentation/Documentation.pdf +9859 -0
  60. package/documentation/README.md +7 -0
  61. package/documentation/documentation.txt +266 -0
  62. package/documentation/gendoc.spec.ts +22 -0
  63. package/examples/1.Simple/simple.pdf +247 -0
  64. package/examples/1.Simple/template.txt +21 -0
  65. package/examples/examples.spec.ts +26 -0
  66. package/package.json +58 -0
@@ -0,0 +1,40 @@
1
+ .SetVar CommandName AddPage
2
+ .Do CommandHeading
3
+ .DrawText 0 %_CurrentY% Add a new page at the end of the document and make it active.
4
+
5
+ .SetVar CommandSubHeading Syntax
6
+ .Do CommandSubHeading
7
+ .SetVar CommandLine1 .AddPage {PageSize}
8
+ .Do CommandLine2
9
+
10
+ .SetVar CommandSubHeading Parameters
11
+ .Do CommandSubHeading
12
+ .SetVar CommandLine1 PageSize
13
+ .SetVar CommandLine2 The page size: A3, A4, Letter, etc. Optional and if not supplied the
14
+ .Do CommandLine2
15
+ .SetVar CommandLine2 current page size is used
16
+ .Do CommandLine2
17
+
18
+ .SetVar CommandSubHeading Other
19
+ .Do CommandSubHeading
20
+ .SetVar CommandLine1 The variable _LastResult is set to the number of the page just created.
21
+ .Do CommandLine
22
+ .incCurrentY %halfLineGap%
23
+ .SetVar CommandLine1 Refer to the 'Other Definitions' chapter for a complete list of supported page sizes.
24
+ .Do CommandLine
25
+
26
+ .SetVar CommandSubHeading Examples
27
+ .Do CommandSubHeading
28
+ .SetVar CommandLine1 Create a new page using the current page size:
29
+ .Do CommandLine
30
+ .incCurrentY %halfLineGap%
31
+ .SetVar CommandLine1 .AddPage
32
+ .Do CommandLine2
33
+
34
+ .incCurrentY %_FontHeight%
35
+ .SetVar CommandLine1 Create a new page with a page size of 'A4':
36
+ .Do CommandLine
37
+ .incCurrentY %halfLineGap%
38
+ .SetVar CommandLine1 .AddPage A4
39
+ .Do CommandLine2
40
+ .incCurrentY %_FontHeight%
@@ -0,0 +1,52 @@
1
+ .SetVar CommandName CheckPage
2
+ .Do CommandHeading
3
+ .SetVar text Check whether the current vertical position (as defined by the _CurrentY variable) is
4
+ .SetVar text %text% within a given distance from the bottom page margin. If so then execute one or more
5
+ .SetVar text %text% optional groups. If no groups are defined then a new page is created.
6
+ .DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %text%
7
+ .incCurrentY %_FontHeight%
8
+ .CheckPage 10 CommandOverflow
9
+ .SetVar text This is the usually used to detect the end of a page and then create any end of page output
10
+ .SetVar text %text% before creating a new page and creating appropriate headings on the new page.
11
+ .DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %text%
12
+
13
+ .SetVar CommandSubHeading Syntax
14
+ .Do CommandSubHeading
15
+ .SetVar CommandLine1 .CheckPage Distance {Group1, Group2 ...}
16
+ .Do CommandLine2
17
+
18
+ .SetVar CommandSubHeading Parameters
19
+ .Do CommandSubHeading
20
+ .SetVar CommandLine1 Distance
21
+ .SetVar CommandLine2 The distance from the bottom margin of the page in the unit of measure specified when the
22
+ .SetVar CommandLine2 %CommandLine2% JsPdfDynamo object was created.
23
+ .Do CommandLine2
24
+ .SetVar CommandLine1 Group(s)
25
+ .SetVar CommandLine2 Zero or more groups to be processed if the current vertical position is beyond
26
+ .SetVar CommandLine2 %CommandLine2% this point. If no groups are provided then a new page is created.
27
+ .Do CommandLine2
28
+
29
+ .SetVar CommandSubHeading Other
30
+ .Do CommandSubHeading
31
+ .SetVar CommandLine1 Variable _LastResult is set to the result of the last group processed. If no groups are defined
32
+ .SetVar CommandLine1 %CommandLine1% this will be the number of the page just created.
33
+ .Do CommandLine
34
+
35
+ .SetVar CommandSubHeading Examples
36
+ .Do CommandSubHeading
37
+ .SetVar CommandLine1 Assuming that the unit of measure is millimeters, check if the current position on the page
38
+ .SetVar CommandLine1 %CommandLine1% is within 10mm of the bottom margin and create a new page if so:
39
+ .Do CommandLine
40
+ .incCurrentY %halfLineGap%
41
+ .SetVar CommandLine1 .CheckPage 10
42
+ .Do CommandLine2
43
+ .incCurrentY %_FontHeight%
44
+
45
+ .SetVar CommandLine1 Assuming that the unit of measure is inches, check if the current position on the page
46
+ .SetVar CommandLine1 %CommandLine1% is within 1.25 inches of the bottom margin and if so,
47
+ .SetVar CommandLine1 %CommandLine1% process the groups PageFooter, AddPage and GroupHeadingContinued:
48
+ .Do CommandLine
49
+ .incCurrentY %halfLineGap%
50
+ .SetVar CommandLine1 .CHECKPAGE 1.25 PageFooter AddPage GroupHeadingContinued
51
+ .Do CommandLine2
52
+ .incCurrentY %_FontHeight%
@@ -0,0 +1,52 @@
1
+ .SetVar CommandName CopyVar
2
+ .Do CommandHeading
3
+ .SetVar CommandLine1 Sets the value of a variable from another variable. This enables the dynamic evaluation
4
+ .SetVar CommandLine1 %CommandLine1% of variable values.
5
+ .Do CommandLine
6
+
7
+ .SetVar CommandSubHeading Syntax
8
+ .Do CommandSubHeading
9
+ .SetVar CommandLine1 .CopyVar CopyTo CopyFrom
10
+ .Do CommandLine2
11
+
12
+ .SetVar CommandSubHeading Parameters
13
+ .Do CommandSubHeading
14
+ .SetVar CommandLine1 CopyTo
15
+ .SetVar CommandLine2 The name of the variable to update. This can be a substitution variable.
16
+ .Do CommandLine2
17
+ .SetVar CommandLine1 CopyFrom
18
+ .SetVar CommandLine2 The name of the variable whose values will be assigned to the variable being
19
+ .SetVar CommandLine2 %CommandLine2% updated. This can be a substitution variable.
20
+ .Do CommandLine2
21
+
22
+ .SetVar CommandSubHeading Other
23
+ .Do CommandSubHeading
24
+ .SetVar CommandLine1 Variable _LastResult is set to '1' if valid variable names are provided, otherwise it is set to '0'.
25
+ .Do CommandLine
26
+ .incCurrentY %halfLineGap%
27
+ .SetVar CommandLine1 The system maintained variables (those whose name starts with an underscore) can
28
+ .SetVar CommandLine1 %CommandLine1% not be changed using this command.
29
+ .Do CommandLine
30
+
31
+ .SetVar CommandSubHeading Examples
32
+ .Do CommandSubHeading
33
+ .SetVar CommandLine1 Set the variable 'SaveCurrentTop' to the system maintained variable '_CurrentY':
34
+ .Do CommandLine
35
+ .incCurrentY %halfLineGap%
36
+ .SetVar CommandLine1 .CopyVar SaveCurrentTop _CurrentY
37
+ .Do CommandLine2
38
+ .incCurrentY %_FontHeight%
39
+
40
+ .CheckPage 15 CommandOverflow
41
+ .SetVar CommandLine1 Given that the variable 'Index' contains '3', save the current value of the variable 'line3'
42
+ .SetVar CommandLine1 %CommandLine1% into the variable 'ThisLine':
43
+ .Do CommandLine
44
+ .incCurrentY %halfLineGap%
45
+ .SetVar CommandLine1 .CopyVar ThisLine line%%%%Index%%%%
46
+ .Do CommandLine2
47
+
48
+ .SetVar CommandSubHeading See Also
49
+ .Do CommandSubHeading
50
+ .SetVar CommandLine1 IncVar, MultVar, SetVar
51
+ .Do CommandLine2
52
+ .incCurrentY %_FontHeight%
@@ -0,0 +1,40 @@
1
+ .SetVar CommandName Do
2
+ .Do CommandHeading
3
+ .DrawText 0 %_CurrentY% 'Do' (ie process) one or more groups of commands that have already been defined.
4
+ .SetVar CommandSubHeading Syntax
5
+ .Do CommandSubHeading
6
+ .SetVar CommandLine1 .Do Group1, Group2...etc
7
+ .Do CommandLine2
8
+
9
+ .SetVar CommandSubHeading Parameters
10
+ .Do CommandSubHeading
11
+ .SetVar CommandLine1 Group(s)
12
+ .SetVar CommandLine2 Zero or more groups to be processed
13
+ .Do CommandLine2
14
+
15
+ .SetVar CommandSubHeading Other
16
+ .Do CommandSubHeading
17
+ .SetVar CommandLine1 Variable _LastResult is set to the result of the last group processed. If there are no groups
18
+ .SetVar CommandLine1 %CommandLine1% specified, or the last group does not exists then _LastResult is set to '0'.
19
+ .Do CommandLine
20
+
21
+ .SetVar CommandSubHeading Examples
22
+ .Do CommandSubHeading
23
+ .SetVar CommandLine1 Process the groups 'NewChapter' and 'NewSection':
24
+ .Do CommandLine
25
+ .incCurrentY %halfLineGap%
26
+ .SetVar CommandLine1 .Do NewChapter NewSection
27
+ .Do CommandLine2
28
+ .incCurrentY %_FontHeight%
29
+ .SetVar CommandLine1 Process the group whose name is stored in the variable 'NextGroup':
30
+ .Do CommandLine
31
+ .incCurrentY %halfLineGap%
32
+ .SetVar CommandLine1 .Do %%%%NextGroup%%%%
33
+ .Do CommandLine2
34
+ .incCurrentY %_FontHeight%
35
+
36
+ .SetVar CommandSubHeading See Also
37
+ .Do CommandSubHeading
38
+ .SetVar CommandLine1 DoRepeat
39
+ .Do CommandLine2
40
+ .incCurrentY %_FontHeight%
@@ -0,0 +1,51 @@
1
+ .SetVar CommandName DoRepeat
2
+ .Do CommandHeading
3
+ .SetVar CommandLine1 Process one or more groups of commands that have already been defined, in
4
+ .SetVar CommandLine1 %CommandLine1% sequence, one or more times.
5
+ .Do CommandLine
6
+
7
+ .SetVar CommandSubHeading Syntax
8
+ .Do CommandSubHeading
9
+ .SetVar CommandLine1 .DoRepeat Number Group1, Group2...etc
10
+ .Do CommandLine2
11
+
12
+ .SetVar CommandSubHeading Parameters
13
+ .Do CommandSubHeading
14
+ .SetVar CommandLine1 Number
15
+ .SetVar CommandLine2 The number of times that the groups will be processed
16
+ .Do CommandLine2
17
+ .SetVar CommandLine1 Group(s)
18
+ .SetVar CommandLine2 Zero or more groups to be processed.
19
+ .Do CommandLine2
20
+
21
+ .SetVar CommandSubHeading Other
22
+ .Do CommandSubHeading
23
+ .SetVar CommandLine1 The group(s) of commands are processed in sequence
24
+ .SetVar CommandLine1 %CommandLine1% as many times as specified by the number.
25
+ .Do CommandLine
26
+ .incCurrentY %halfLineGap%
27
+ .SetVar CommandLine1 The variable _LastResult is set to the result of the last group processed. If there are no
28
+ .SetVar CommandLine1 %CommandLine1% groups specified, or the last group does not exists then _LastResult is set to '0'.
29
+ .Do CommandLine
30
+
31
+ .SetVar CommandSubHeading Examples
32
+ .Do CommandSubHeading
33
+ .SetVar CommandLine1 Process the groups 'Heading', 'Detail', 'Footer' in sequence, three times. (This will be 'Heading',
34
+ .SetVar CommandLine1 %CommandLine1% 'Detail', 'Footer', 'Heading', 'Detail', 'Footer', 'Heading', 'Detail, 'Footer'):
35
+ .Do CommandLine
36
+ .incCurrentY %halfLineGap%
37
+ .SetVar CommandLine1 .DoRepeat 3 Heading Detail Footer
38
+ .Do CommandLine2
39
+ .incCurrentY %_FontHeight%
40
+ .SetVar CommandLine1 Process the group PrintAddress the number of times stored in the variable 'AddressCount':
41
+ .Do CommandLine
42
+ .incCurrentY %halfLineGap%
43
+ .SetVar CommandLine1 .DoRepeat %%%%AddressCount%%%% PrintAddress
44
+ .Do CommandLine2
45
+ .incCurrentY %_FontHeight%
46
+
47
+ .SetVar CommandSubHeading See Also
48
+ .Do CommandSubHeading
49
+ .SetVar CommandLine1 Do
50
+ .Do CommandLine2
51
+ .incCurrentY %_FontHeight%
@@ -0,0 +1,67 @@
1
+ .SetVar CommandName DrawBox
2
+ .Do CommandHeading
3
+ .DrawText 0 %_CurrentY% Draw a box at given point using the current fill colour, line colour and line width.
4
+
5
+ .SetVar CommandSubHeading Syntax
6
+ .Do CommandSubHeading
7
+ .SetVar CommandLine1 .DrawBox Left Top Width Height Option
8
+ .Do CommandLine2
9
+
10
+ .SetVar CommandSubHeading Parameters
11
+ .Do CommandSubHeading
12
+ .SetVar CommandLine1 Left
13
+ .SetVar CommandLine2 The horizontal starting position of the box, measured from the left margin.
14
+ .Do CommandLine2
15
+ .SetVar CommandLine1 Top
16
+ .SetVar CommandLine2 The vertical starting position of the box, measured from the top margin.
17
+ .Do CommandLine2
18
+ .SetVar CommandLine1 Width
19
+ .SetVar CommandLine2 The width of the box.
20
+ .Do CommandLine2
21
+ .SetVar CommandLine1 Height
22
+ .SetVar CommandLine2 The height of the box.
23
+ .Do CommandLine2
24
+ .SetVar CommandLine1 Option
25
+ .SetVar CommandLine2 Specifies how the box is drawn:
26
+ .Do CommandLine2
27
+ .incCurrentY %halfLineGap%
28
+ .SetVar CommandLine3 0 - An outline of the box is drawn
29
+ .Do CommandLine2
30
+ .SetVar CommandLine3 1 - A filled box, without an outline is drawn
31
+ .Do CommandLine2
32
+ .SetVar CommandLine3 2 - A filled box, with an outline is drawn
33
+ .Do CommandLine2
34
+ .incCurrentY %halfLineGap%
35
+ .SetVar CommandLine1 All measurements are in the unit of measure specified when the JsPdfDynamo object was created.
36
+ .Do CommandLine
37
+
38
+ .SetVar CommandSubHeading Other
39
+ .Do CommandSubHeading
40
+ .SetVar CommandLine1 The variable _LastResult is set to '0' if there were any issues with the parameters
41
+ .SetVar CommandLine1 %CommandLine1% provided, otherwise it is set to '1'.
42
+ .Do CommandLine
43
+
44
+ .SetVar CommandSubHeading Examples
45
+ .Do CommandSubHeading
46
+ .SetVar CommandLine1 Assuming that the unit of measure is millimeters,
47
+ .SetVar CommandLine1 %CommandLine1% an outline of a box is drawn at the current vertical position that
48
+ .SetVar CommandLine1 %CommandLine1% spans the width of the page and is 14.5 millimeters high.
49
+ .Do CommandLine
50
+ .incCurrentY %halfLineGap%
51
+ .SetVar CommandLine1 .DrawBox 0 %%%%_CurrentY%%%% %%%%_PageWidth%%%% 14.5 0
52
+ .Do CommandLine2
53
+
54
+ .incCurrentY %_FontHeight%
55
+ .SetVar CommandLine1 Assuming that the unit of measure is inches,
56
+ .SetVar CommandLine1 %CommandLine1% an outlined and filled box is drawn at the top of the page that spans the width
57
+ .SetVar CommandLine1 %CommandLine1% of the page and is ½ inch high.
58
+ .Do CommandLine
59
+ .incCurrentY %halfLineGap%
60
+ .SetVar CommandLine1 .DrawBox 0 0 %%%%_PageWidth%%%% 0.5 2
61
+ .Do CommandLine2
62
+
63
+ .SetVar CommandSubHeading See Also
64
+ .Do CommandSubHeading
65
+ .SetVar CommandLine1 SetFillColour, SetLineColour, SetLineWidth
66
+ .Do CommandLine2
67
+ .incCurrentY %_FontHeight%
@@ -0,0 +1,41 @@
1
+ .SetVar CommandName DrawDebugGrid
2
+ .Do CommandHeading
3
+ .SetVar CommandLine1 Draws a grid on the current page and is useful when designing or debugging templates. The
4
+ .SetVar CommandLine1 %CommandLine1% distance between grid lines is dependent on the unit of measure specified when the
5
+ .SetVar CommandLine1 %CommandLine1% JsPdfDynamo object was created, and is either 10mm, ½ inch, or 30 points.
6
+ .Do CommandLine
7
+
8
+ .SetVar CommandSubHeading Syntax
9
+ .Do CommandSubHeading
10
+ .SetVar CommandLine1 .DrawDebugGrid Option
11
+ .Do CommandLine2
12
+
13
+ .SetVar CommandSubHeading Parameters
14
+ .Do CommandSubHeading
15
+ .SetVar CommandLine1 Option
16
+ .SetVar CommandLine2 Specifies whether the grid is drawn over the full page, or just within the current margins.
17
+ .SetVar CommandLine2 %CommandLine2% Valid values are 'Margin' and 'Page'. If not given then the default value
18
+ .SetVar CommandLine2 %CommandLine2% of 'Margin' is used.
19
+ .Do CommandLine2
20
+
21
+ .SetVar CommandSubHeading Examples
22
+ .Do CommandSubHeading
23
+ .SetVar CommandLine1 Draws a debug grid on the current page, starting from the top left of the page
24
+ .SetVar CommandLine1 %CommandLine1% down to the bottom right.
25
+ .Do CommandLine
26
+ .incCurrentY %halfLineGap%
27
+ .SetVar CommandLine1 .DrawDebugGrid Page
28
+ .Do CommandLine2
29
+ .incCurrentY %_FontHeight%
30
+
31
+ .SetVar CommandLine1 Draws a debug grid on all pages of the document, within the current margin settings.
32
+ .Do CommandLine
33
+ .incCurrentY %halfLineGap%
34
+ .SetVar CommandLine1 .ForEachPage .DrawDebugGrid
35
+ .Do CommandLine2
36
+
37
+ .SetVar CommandSubHeading See Also
38
+ .Do CommandSubHeading
39
+ .SetVar CommandLine1 ForEachPage
40
+ .Do CommandLine2
41
+ .incCurrentY %_FontHeight%
@@ -0,0 +1,92 @@
1
+ .SetVar CommandName DrawImage
2
+ .Do CommandHeading
3
+ .SetVar CommandLine1 Draws a previously loaded image on the current page.
4
+ .Do CommandLine
5
+
6
+ .SetVar CommandSubHeading Syntax
7
+ .Do CommandSubHeading
8
+ .SetVar CommandLine1 .DrawImage ImageNo Left Top Width Height Scale
9
+ .Do CommandLine2
10
+
11
+ .SetVar CommandSubHeading Parameters
12
+ .Do CommandSubHeading
13
+ .SetVar CommandLine1 ImageNo
14
+ .SetVar CommandLine2 The image Id. This was obtained when the image was loaded from the _LastImageAdded variable.
15
+ .Do CommandLine2
16
+ .SetVar CommandLine1 Left
17
+ .SetVar CommandLine2 The horizontal starting position of the image, measured from the left margin.
18
+ .Do CommandLine2
19
+ .SetVar CommandLine1 Top
20
+ .SetVar CommandLine2 The vertical starting position of the image, measured from the top margin.
21
+ .Do CommandLine2
22
+ .SetVar CommandLine1 Width
23
+ .SetVar CommandLine2 The width of the image to be drawn in the document. This is optional.
24
+ .Do CommandLine2
25
+ .SetVar CommandLine1 Height
26
+ .SetVar CommandLine2 The height of the image to be drawn in the document. This is optional.
27
+ .Do CommandLine2
28
+ .SetVar CommandLine1 Scale
29
+ .SetVar CommandLine2 A scaling factor to apply to the image. This is optional.
30
+ .Do CommandLine2
31
+
32
+ .SetVar CommandSubHeading Other
33
+ .Do CommandSubHeading
34
+ .SetVar CommandLine1 The variable _LastResult is set to '0' if there were any issues with the parameters
35
+ .SetVar CommandLine1 %CommandLine1% provided, or if the image will not fit within the margins, otherwise it is set to '1'.
36
+ .Do CommandLine
37
+ .incCurrentY %halfLineGap%
38
+ .SetVar CommandLine1 There are a number of combinations of width, height and scaling factor that provide
39
+ .SetVar CommandLine1 %CommandLine1% flexibility in the size of the image that is rendered in the document:
40
+ .Do CommandLine
41
+ .incCurrentY %halfLineGap%
42
+ .SetVar CommandLine1 -
43
+ .SetVar CommandLine1b If none of the width, height or scale parameters are given, or are zero,
44
+ .SetVar CommandLine1b %CommandLine1b% then the image will be rendered using the dimensions of the image.
45
+ .Do CommandLine2
46
+ .incCurrentY %halfLineGap%
47
+ .SetVar CommandLine1 -
48
+ .SetVar CommandLine1b If the width is given, and is not zero, and both the height and scale are not given or are zero,
49
+ .SetVar CommandLine1b %CommandLine1b% then the height of the image is proportionally scaled.
50
+ .Do CommandLine2
51
+ .incCurrentY %halfLineGap%
52
+ .SetVar CommandLine1 -
53
+ .SetVar CommandLine1b If the height is given, and is not zero, and both the width and scale are not given or are zero,
54
+ .SetVar CommandLine1b %CommandLine1b% then the width of the image is proportionally scaled.
55
+ .Do CommandLine2
56
+ .incCurrentY %halfLineGap%
57
+ .SetVar CommandLine1 -
58
+ .SetVar CommandLine1b If the width or height is given, or both, and the scale is not given or is zero,
59
+ .SetVar CommandLine1b %CommandLine1b% then the dimensions of the image will be calculated as either the
60
+ .SetVar CommandLine1b %CommandLine1b% provided dimension or the image dimension.
61
+ .Do CommandLine2
62
+ .incCurrentY %halfLineGap%
63
+ .SetVar CommandLine1 -
64
+ .SetVar CommandLine1b If the width or height is given, or both, and the scale is given,
65
+ .SetVar CommandLine1b %CommandLine1b% then the dimensions of the image will be calculated as either the
66
+ .SetVar CommandLine1b %CommandLine1b% provided dimension or the image dimension. These dimensions
67
+ .SetVar CommandLine1b %CommandLine1b% will then be scaled by multiplying by the scaling factor.
68
+ .Do CommandLine2
69
+
70
+ .SetVar CommandSubHeading Examples
71
+ .Do CommandSubHeading
72
+ .SetVar CommandLine1 Draws a previously loaded image on the current page, located at the current
73
+ .SetVar CommandLine1 %CommandLine1% location on the page.
74
+ .Do CommandLine
75
+ .incCurrentY %halfLineGap%
76
+ .SetVar CommandLine1 .DrawImage %%%%ImageId%%%% %%%%_CurrentX%%%% %%%%_CurrentY%%%%
77
+ .Do CommandLine2
78
+ .incCurrentY %_FontHeight%
79
+ .SetVar CommandLine1 Assuming that the unit of measure is millimeters,
80
+ .SetVar CommandLine1 %CommandLine1% draws a previously loaded logo image on the current page, located at the top left of
81
+ .SetVar CommandLine1 %CommandLine1% the page and scaled proportionally to be 10mm high.
82
+ .Do CommandLine
83
+ .incCurrentY %halfLineGap%
84
+ .SetVar CommandLine1 .DrawImage %%%%LogoId%%%% 0 0 0 10
85
+ .Do CommandLine2
86
+ .incCurrentY %_FontHeight%
87
+
88
+ .SetVar CommandSubHeading See Also
89
+ .Do CommandSubHeading
90
+ .SetVar CommandLine1 AddImageFromFile, AddImageFromUrl
91
+ .Do CommandLine2
92
+ .incCurrentY %_FontHeight%
@@ -0,0 +1,62 @@
1
+ .SetVar CommandName DrawLine
2
+ .Do CommandHeading
3
+ .SetVar CommandLine1 Draw a line between two points on the same page, relative to the page margins. The
4
+ .SetVar CommandLine1 %CommandLine1% width and the colour of the line is set by the most recent SetLineColour and
5
+ .SetVar CommandLine1 %CommandLine1% SetLineWidth commands.
6
+ .Do CommandLine
7
+
8
+ .SetVar CommandSubHeading Syntax
9
+ .Do CommandSubHeading
10
+ .SetVar CommandLine1 .DrawLine Left Top Right Bottom
11
+ .Do CommandLine2
12
+
13
+ .SetVar CommandSubHeading Parameters
14
+ .Do CommandSubHeading
15
+ .SetVar CommandLine1 Left
16
+ .SetVar CommandLine2 The horizontal starting position of the line, measured from the left margin.
17
+ .Do CommandLine2
18
+ .SetVar CommandLine1 Top
19
+ .SetVar CommandLine2 The vertical starting position of the line, measured from the top margin.
20
+ .Do CommandLine2
21
+ .SetVar CommandLine1 Right
22
+ .SetVar CommandLine2 The horizontal ending position of the line, measured from the left margin.
23
+ .Do CommandLine2
24
+ .SetVar CommandLine1 Bottom
25
+ .SetVar CommandLine2 The vertical ending position of the line, measured from the top margin.
26
+ .Do CommandLine2
27
+
28
+ .SetVar CommandSubHeading Other
29
+ .Do CommandSubHeading
30
+ .SetVar CommandLine1 Variable _LastResult is set to '0' if any of the positions fall outside of the current
31
+ .SetVar CommandLine1 %CommandLine1% page margins, otherwise it is set to '1'.
32
+ .Do CommandLine
33
+ .incCurrentY %halfLineGap%
34
+ .SetVar CommandLine1 The variables _CurrentX and _CurrentY are not changed by this command.
35
+ .Do CommandLine
36
+ .incCurrentY %halfLineGap%
37
+ .SetVar CommandLine1 The variables _LastObjectHeight and _LastObjectWidth are updated to reflect the vertical
38
+ .SetVar CommandLine1 %CommandLine1% and horizontal sizes of the line just drawn and not the
39
+ .SetVar CommandLine1 %CommandLine1% diagonal length of that line.
40
+ .Do CommandLine
41
+
42
+ .SetVar CommandSubHeading Examples
43
+ .Do CommandSubHeading
44
+ .SetVar CommandLine1 Assuming that the unit of measure is millimeters,
45
+ .SetVar CommandLine1 %CommandLine1% output a vertical line 15cm from the left margin:
46
+ .Do CommandLine
47
+ .incCurrentY %halfLineGap%
48
+ .SetVar CommandLine1 .DrawLine 150 0 150 %%%%_PageHeight%%%%
49
+ .Do CommandLine2
50
+
51
+ .incCurrentY %_FontHeight%
52
+ .SetVar CommandLine1 Output a horizontal line at the current vertical position on the page:
53
+ .Do CommandLine
54
+ .incCurrentY %halfLineGap%
55
+ .SetVar CommandLine1 .DrawLine 0 %%%%_CurrentY%%%% %%%%_PageWidth%%%% %%%%_CurrentY%%%%
56
+ .Do CommandLine2
57
+
58
+ .SetVar CommandSubHeading See Also
59
+ .Do CommandSubHeading
60
+ .SetVar CommandLine1 SetLineColour, SetLineWidth
61
+ .Do CommandLine2
62
+ .incCurrentY %_FontHeight%
@@ -0,0 +1,61 @@
1
+ .SetVar CommandName DrawText
2
+ .Do CommandHeading
3
+ .DrawText 0 %_CurrentY% Draw text at the given point on the page, relative to the page margins.
4
+
5
+ .SetVar CommandSubHeading Syntax
6
+ .Do CommandSubHeading
7
+ .SetVar CommandLine1 .DrawText Left Top Text
8
+ .Do CommandLine2
9
+
10
+ .SetVar CommandSubHeading Parameters
11
+ .Do CommandSubHeading
12
+ .SetVar CommandLine1 Left
13
+ .SetVar CommandLine2 The position of the text, measured from the left margin.
14
+ .Do CommandLine2
15
+ .SetVar CommandLine1 Top
16
+ .SetVar CommandLine2 The position of the text, measured from the top margin.
17
+ .Do CommandLine2
18
+ .SetVar CommandLine1 Text
19
+ .SetVar CommandLine2 The text to be output using the current font, style and size.
20
+ .Do CommandLine2
21
+
22
+ .SetVar CommandSubHeading Other
23
+ .Do CommandSubHeading
24
+
25
+ .SetVar CommandLine1 Variable _LastResult is set to '0' if the position falls outside of the
26
+ .SetVar CommandLine1 %CommandLine1% page margins, or the text is truncated to fit within the
27
+ .SetVar CommandLine1 %CommandLine1% page margins, otherwise it is set to '1'.
28
+ .Do CommandLine
29
+ .incCurrentY %halfLineGap%
30
+ .SetVar CommandLine1 The variable _CurrentX is incremented by the width of the text plus the value
31
+ .SetVar CommandLine1 %CommandLine1% of the current horizontal spacing variable, _SpaceHoz.
32
+ .Do CommandLine
33
+ .incCurrentY %halfLineGap%
34
+ .SetVar CommandLine1 The variable _CurrentY is incremented by the height plus the value of the current vertical
35
+ .SetVar CommandLine1 %CommandLine1% spacing variable, _SpaceVert.
36
+ .Do CommandLine
37
+ .incCurrentY %halfLineGap%
38
+ .SetVar CommandLine1 The variables _LastObjectHeight and _LastObjectWidth are
39
+ .SetVar CommandLine1 %CommandLine1% updated to reflect the height of the text just output.
40
+ .Do CommandLine
41
+
42
+ .SetVar CommandSubHeading Examples
43
+ .Do CommandSubHeading
44
+ .SetVar CommandLine1 Output some text starting from the left margin at the current vertical position on the page:
45
+ .Do CommandLine
46
+ .incCurrentY %halfLineGap%
47
+ .SetVar CommandLine1 .DrawText 0 %%%%_CurrentY%%%% JsPdfDynamo is a work of beauty!
48
+ .Do CommandLine2
49
+
50
+ .incCurrentY %_FontHeight%
51
+ .SetVar CommandLine1 Substitution variables can be used in the text:
52
+ .Do CommandLine
53
+ .incCurrentY %halfLineGap%
54
+ .SetVar CommandLine1 .DrawText 15 30 Who does number %%%%number%%%% work for?
55
+ .Do CommandLine2
56
+
57
+ .SetVar CommandSubHeading See Also
58
+ .Do CommandSubHeading
59
+ .SetVar CommandLine1 DrawTextBox, DrawTextWrapped, SetFontName, SetFontSize, SetFontStyle, SetTextColour
60
+ .Do CommandLine2
61
+ .incCurrentY %_FontHeight%
@@ -0,0 +1,99 @@
1
+ .SetVar CommandName DrawTextBox
2
+ .Do CommandHeading
3
+ .SetVar CommandLine1 Draw text within the bounds of a given box. This is can be used to justify text
4
+ .SetVar CommandLine1 %CommandLine1% horizontally and/or vertically within a defined area.
5
+ .Do CommandLine
6
+
7
+ .SetVar CommandSubHeading Syntax
8
+ .Do CommandSubHeading
9
+ .SetVar CommandLine1 .DrawTextBox Left Top Width Height Horizontal-alignment Vertical-alignment Text
10
+ .Do CommandLine2
11
+
12
+ .SetVar CommandSubHeading Parameters
13
+ .Do CommandSubHeading
14
+ .SetVar CommandLine1 Left
15
+ .SetVar CommandLine2 The position of the area containing the text, measured from the left margin.
16
+ .Do CommandLine2
17
+ .SetVar CommandLine1 Top
18
+ .SetVar CommandLine2 The position of the area containing the text, measured from the top margin.
19
+ .Do CommandLine2
20
+ .SetVar CommandLine1 Width
21
+ .SetVar CommandLine2 The width of the area containing the text.
22
+ .Do CommandLine2
23
+ .SetVar CommandLine1 Height
24
+ .SetVar CommandLine2 The height of the area containing the text.
25
+ .Do CommandLine2
26
+ .SetVar CommandLine1 Horizontal-
27
+ .SetVar CommandLine2 Specifies how the text is aligned horizontally within the bounding box:
28
+ .Do CommandLine2
29
+ .SetVar CommandLine1 alignment
30
+ .SetVar CommandLine3 Left or 'L' - Left justified
31
+ .Do CommandLine2
32
+ .SetVar CommandLine3 Centre or 'C' - Centre justified
33
+ .Do CommandLine2
34
+ .SetVar CommandLine3 Right or 'R' - Right justified
35
+ .Do CommandLine2
36
+ .incCurrentY %halfLineGap%
37
+ .SetVar CommandLine1 Vertical-
38
+ .SetVar CommandLine2 Specifies how the text is aligned vertically within the bounding box:
39
+ .Do CommandLine2
40
+ .SetVar CommandLine1 alignment
41
+ .SetVar CommandLine3 Top or 'T' - Top aligned
42
+ .Do CommandLine2
43
+ .SetVar CommandLine3 Centre or 'C' - Centre aligned
44
+ .Do CommandLine2
45
+ .SetVar CommandLine3 Bottom or 'B' - Bottom aligned
46
+ .Do CommandLine2
47
+ .incCurrentY %halfLineGap%
48
+ .SetVar CommandLine1 Text
49
+ .SetVar CommandLine2 The text to be output using the current font type, style and size.
50
+ .Do CommandLine2
51
+
52
+ .SetVar CommandSubHeading Other
53
+ .Do CommandSubHeading
54
+
55
+ .SetVar text Variable _LastResult is set to '0' if the position falls outside of the
56
+ .SetVar text %text% page margins, or the box area would not fit within the
57
+ .SetVar text %text% page margins, otherwise it is set to '1'.
58
+ .DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %text%
59
+ .incCurrentY %halfLineGap%
60
+ .SetVar text The variable _CurrentX is incremented by the
61
+ .SetVar text %text% width of the box plus the value of the current horizontal spacing variable, _SpaceHoz.
62
+ .DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %text%
63
+ .incCurrentY %halfLineGap%
64
+ .SetVar text The variable _CurrentY is incremented by the height of the box plus the value of the current vertical
65
+ .SetVar text %text% spacing variable, _SpaceVert.
66
+ .DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %text%
67
+ .incCurrentY %halfLineGap%
68
+ .SetVar text The variables _LastObjectHeight and _LastObjectWidth are updated to reflect the height of the box just output.
69
+ .DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %text%
70
+
71
+ .incCurrentY %_FontHeight%
72
+ .SetVar CommandLine1 Note that there is no outline drawn of the box. If this is required, draw the box using the
73
+ .SetVar CommandLine1 %CommandLine1% DrawBox command before drawing the text box.
74
+ .Do CommandLine
75
+
76
+ .SetVar CommandSubHeading Examples
77
+ .Do CommandSubHeading
78
+ .SetVar CommandLine1 Output a centered title at the top of the page:
79
+ .Do CommandLine
80
+ .incCurrentY %halfLineGap%
81
+ .SetVar CommandLine1 .DrawTextBox 0 0 %%%%_PageWidth%%%% C T CONFIDENTIAL
82
+ .Do CommandLine2
83
+
84
+ .incCurrentY %_FontHeight%
85
+ .SetVar CommandLine1 Print the page number on the bottom right of a page:
86
+ .Do CommandLine
87
+ .incCurrentY %halfLineGap%
88
+ .SetVar CommandLine1 .SetVar textTop %%%%_PageHeight%%%%
89
+ .Do CommandLine2
90
+ .SetVar CommandLine1 .IncVar textTop -6
91
+ .Do CommandLine2
92
+ .SetVar CommandLine1 .DrawTextBox 0 %%%%textTop%%%% %%%%_PageWidth%%%% 6 Right Top Page: %%%%_PageNo%%%%
93
+ .Do CommandLine2
94
+
95
+ .SetVar CommandSubHeading See Also
96
+ .Do CommandSubHeading
97
+ .SetVar CommandLine1 DrawBox, DrawText, DrawTextWrapped, SetFontName, SetFontSize, SetFontStyle, SetTextColour
98
+ .Do CommandLine2
99
+ .incCurrentY %_FontHeight%