jspdf-dynamo 1.0.1 → 1.0.5

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 (52) hide show
  1. package/dist/index.cjs +90 -30
  2. package/dist/index.d.cts +18 -6
  3. package/dist/index.d.ts +18 -6
  4. package/dist/index.js +90 -30
  5. package/documentation/3. Variables/Introduction.txt +15 -12
  6. package/documentation/3. Variables/SystemMaintained.txt +47 -63
  7. package/documentation/4. Commands/AddBookmark.txt +4 -4
  8. package/documentation/4. Commands/AddPage.txt +6 -4
  9. package/documentation/4. Commands/CheckPage.txt +3 -3
  10. package/documentation/4. Commands/Commands.txt +7 -0
  11. package/documentation/4. Commands/CopyVar.txt +3 -3
  12. package/documentation/4. Commands/DivVar.txt +67 -0
  13. package/documentation/4. Commands/Do.txt +3 -3
  14. package/documentation/4. Commands/DoRepeat.txt +3 -3
  15. package/documentation/4. Commands/DrawBox.txt +3 -3
  16. package/documentation/4. Commands/DrawDebugGrid.txt +3 -3
  17. package/documentation/4. Commands/DrawImage.txt +4 -4
  18. package/documentation/4. Commands/DrawLine.txt +3 -3
  19. package/documentation/4. Commands/DrawTextBox.txt +1 -1
  20. package/documentation/4. Commands/DrawTextWrapped.txt +40 -17
  21. package/documentation/4. Commands/ForEachPage.txt +4 -4
  22. package/documentation/4. Commands/GetEnvVar.txt +2 -2
  23. package/documentation/4. Commands/IfEq.txt +53 -0
  24. package/documentation/4. Commands/IfGt.txt +1 -1
  25. package/documentation/4. Commands/IfNotBlank.txt +3 -3
  26. package/documentation/4. Commands/IncCurrentX.txt +1 -1
  27. package/documentation/4. Commands/IncCurrentY.txt +1 -1
  28. package/documentation/4. Commands/IncVar.txt +8 -8
  29. package/documentation/4. Commands/Include.txt +8 -8
  30. package/documentation/4. Commands/IncludeUrl.txt +43 -1
  31. package/documentation/4. Commands/{AddImageFromFile.txt → LoadImageFromFile.txt } +6 -6
  32. package/documentation/4. Commands/{AddImageFromUrl.txt → LoadImageFromUrl.txt } +6 -6
  33. package/documentation/4. Commands/MultVar.txt +11 -14
  34. package/documentation/4. Commands/SavePdf.txt +6 -0
  35. package/documentation/4. Commands/SelectPage.txt +6 -0
  36. package/documentation/4. Commands/SetCurrentX.txt +5 -5
  37. package/documentation/4. Commands/SetCurrentY.txt +3 -3
  38. package/documentation/4. Commands/SetDocumentInfo.txt +3 -3
  39. package/documentation/4. Commands/SetFillColour.txt +8 -25
  40. package/documentation/4. Commands/SetFontName.txt +3 -1
  41. package/documentation/4. Commands/SetFontSize.txt +2 -0
  42. package/documentation/4. Commands/SetLineColour.txt +8 -26
  43. package/documentation/4. Commands/SetLineWidth.txt +7 -7
  44. package/documentation/4. Commands/SetLogLevel.txt +6 -0
  45. package/documentation/4. Commands/SetMargin.txt +11 -14
  46. package/documentation/4. Commands/SetTextColour.txt +43 -0
  47. package/documentation/4. Commands/SetVar.txt +9 -10
  48. package/documentation/4. Commands/WriteLog.txt +56 -0
  49. package/documentation/Documentation.pdf +3430 -2703
  50. package/documentation/documentation.txt +13 -12
  51. package/package.json +2 -2
  52. package/documentation/4. Commands/SetPageOrientation.txt +0 -42
@@ -4,55 +4,37 @@
4
4
 
5
5
  .SetVar CommandSubHeading Syntax
6
6
  .Do CommandSubHeading
7
- .SetVar CommandLine1 .SetLineColor Red Green Blue
7
+ .SetVar CommandLine1 .SetLineColor Colour
8
8
  .Do CommandLine2
9
9
 
10
10
  .SetVar CommandSubHeading Parameters
11
11
  .Do CommandSubHeading
12
- .SetVar CommandLine1 Red
13
- .SetVar CommandLine2 The amount of red in the colour, represented as a number in the range
14
- .Do CommandLine2
15
- .SetVar CommandLine2 of 0 to 255
16
- .Do CommandLine2
17
- .SetVar CommandLine1 Green
18
- .SetVar CommandLine2 The amount of green in the colour, represented as a number in the range
19
- .Do CommandLine2
20
- .SetVar CommandLine2 of 0 to 255
21
- .Do CommandLine2
22
- .SetVar CommandLine1 Blue
23
- .SetVar CommandLine2 The amount of blue in the colour, represented as a number in the range
24
- .Do CommandLine2
25
- .SetVar CommandLine2 of 0 to 255
26
- .Do CommandLine2
12
+ .SetVar CommandLine1 Colour
13
+ .SetVar CommandLine2 Either a CSS named colour or a hexadecimal RGB colour.
27
14
 
28
15
  .SetVar CommandSubHeading Other
29
16
  .Do CommandSubHeading
30
- .SetVar CommandLine1 Colours are specified in the RGB style using three numbers in the range of 0 to 255,
31
- .Do CommandLine
32
- .SetVar CommandLine1 representing the amount of red, green and blue in the final colour.
33
- .Do CommandLine
34
- .incCurrentY %halfLineGap%
35
17
  .SetVar CommandLine1 The variable _LastResult is set to '1' by this command.
36
18
  .Do CommandLine
37
19
 
38
20
  .SetVar CommandSubHeading Examples
39
21
  .Do CommandSubHeading
40
- .SetVar CommandLine1 Set the colour of subsequent lines to be black:
22
+ .SetVar CommandLine1 Set the colour of subsequent lines to be purple:
41
23
  .Do CommandLine
42
24
  .incCurrentY %halfLineGap%
43
- .SetVar CommandLine1 .SetLineColour 0 0 0
25
+ .SetVar CommandLine1 .SetLineColour purple
44
26
  .Do CommandLine2
45
27
 
46
28
  .incCurrentY %_FontHeight%
47
- .SetVar CommandLine1 Set the colour of subsequent lines to be blue:
29
+ .SetVar CommandLine1 Set the colour of subsequent lines to be bright pink:
48
30
  .Do CommandLine
49
31
  .incCurrentY %halfLineGap%
50
- .SetVar CommandLine1 .SetLineColour 0 0 200
32
+ .SetVar CommandLine1 .SetLineColour #ff69b4
51
33
  .Do CommandLine2
52
34
 
53
35
  .SetVar CommandSubHeading See Also
54
36
  .Do CommandSubHeading
55
- .SetVar CommandLine1 DrawBox, DrawLine, SetFillColour, SetLineWidth
37
+ .SetVar CommandLine1 DrawBox, DrawLine, SetFillColour, SetLineWidth, SetTextColour
56
38
  .Do CommandLine
57
39
 
58
40
  .incCurrentY %_FontHeight%
@@ -4,13 +4,13 @@
4
4
 
5
5
  .SetVar CommandSubHeading Syntax
6
6
  .Do CommandSubHeading
7
- .SetVar CommandLine1 .SetLineWidth Width
7
+ .SetVar CommandLine1 .SetLineWidth Width
8
8
  .Do CommandLine2
9
9
 
10
10
  .SetVar CommandSubHeading Parameters
11
11
  .Do CommandSubHeading
12
12
  .SetVar CommandLine1 Width
13
- .SetVar CommandLine2 The width of the line(s) to be drawn in millimeters, as a floating point number
13
+ .SetVar CommandLine2 The width of the line(s) to be drawn, as a floating point number
14
14
  .Do CommandLine2
15
15
 
16
16
  .SetVar CommandSubHeading Other
@@ -20,23 +20,23 @@
20
20
 
21
21
  .SetVar CommandSubHeading Examples
22
22
  .Do CommandSubHeading
23
- .SetVar CommandLine1 Set the width of subsequent lines to be 0.5mm:
23
+ .SetVar CommandLine1 Assuming that the unit of measure is millimeters, set the width of subsequent lines to be 0.5mm:
24
24
  .Do CommandLine
25
25
  .incCurrentY %halfLineGap%
26
- .SetVar CommandLine1 .SetLineWidth 0.5
26
+ .SetVar CommandLine1 .SetLineWidth 0.5
27
27
  .Do CommandLine2
28
28
 
29
29
  .incCurrentY %_FontHeight%
30
- .SetVar CommandLine1 Set the width of subsequent lines to be 1mm:
30
+ .SetVar CommandLine1 Assuming that the unit of measure is inches, set the width of subsequent lines to be 0.02 inch:
31
31
  .Do CommandLine
32
32
  .incCurrentY %halfLineGap%
33
- .SetVar CommandLine1 .SetLineWidth 1
33
+ .SetVar CommandLine1 .SetLineWidth 0.02
34
34
  .Do CommandLine2
35
35
  .incCurrentY %_FontHeight%
36
36
 
37
37
  .SetVar CommandSubHeading See Also
38
38
  .Do CommandSubHeading
39
- .SetVar CommandLine1 DrawBox, DrawLine, SetFillColour, SetLineColour
39
+ .SetVar CommandLine1 DrawBox, DrawLine, SetLineColour
40
40
  .Do CommandLine
41
41
 
42
42
  .incCurrentY %_FontHeight%
@@ -0,0 +1,6 @@
1
+ .SetVar CommandName SetLogLevel
2
+ .Do CommandHeading
3
+ .SetVar CommandLine1 To be documented.
4
+ .Do CommandLine
5
+
6
+ .incCurrentY %_FontHeight%
@@ -1,14 +1,13 @@
1
1
  .SetVar CommandName SetMargin
2
2
  .Do CommandHeading
3
- .DrawText 0 %_CurrentY% Set the page margins. The margins will remain in effect until changed by a subsequent
4
- .SetVar CommandLine1 SetMargin command. It is not unusual to change left and right margins multiple times
5
- .Do CommandLine
6
- .SetVar CommandLine1 on the same page.
3
+ .SetVar CommandLine1 Set the page margins. The margins will remain in effect until changed by a subsequent SetMargin
4
+ .SetVar CommandLine1 %CommandLine1% command. It is not unusual to change left and right margins multiple times
5
+ .SetVar CommandLine1 %CommandLine1% on the same page.
7
6
  .Do CommandLine
8
7
 
9
8
  .SetVar CommandSubHeading Syntax
10
9
  .Do CommandSubHeading
11
- .SetVar CommandLine1 .SetMargin Side Size
10
+ .SetVar CommandLine1 .SetMargin Side Size
12
11
  .Do CommandLine2
13
12
 
14
13
  .SetVar CommandSubHeading Parameters
@@ -32,7 +31,7 @@
32
31
  .SetVar CommandLine2 V or Vertical - Both vertical margins, top and bottom
33
32
  .Do CommandLine2
34
33
  .SetVar CommandLine1 Size
35
- .SetVar CommandLine2 The size of the margin in millimeters.
34
+ .SetVar CommandLine2 The size of the margin.
36
35
  .Do CommandLine2
37
36
 
38
37
  .SetVar CommandSubHeading Other
@@ -43,27 +42,25 @@
43
42
  .SetVar CommandLine1 The appropriate variables _MarginLeft, _MarginRight, _MarginTop and _MarginBottom are
44
43
  .Do CommandLine
45
44
  .SetVar CommandLine1 set, while the _PageWidth and _Page_Height variables are re-calculated based on the
46
- .Do CommandLine
47
- .SetVar CommandLine1 current page size and margins.
45
+ .SetVar CommandLine1 %CommandLine1% current page size and margins.
48
46
  .Do CommandLine
49
47
  .incCurrentY %halfLineGap%
50
48
  .SetVar CommandLine1 Note that changing the margins does not change the values of the current position variables,
51
- .Do CommandLine
52
- .SetVar CommandLine1 _CurrentY and _CurrentX, which are always relative to the current margins.
49
+ .SetVar CommandLine1 %CommandLine1% _CurrentY and _CurrentX, which are always relative to the current margins.
53
50
  .Do CommandLine
54
51
 
55
52
  .SetVar CommandSubHeading Examples
56
53
  .Do CommandSubHeading
57
- .SetVar CommandLine1 Set all margins (from now on) to 10mm:
54
+ .SetVar CommandLine1 Assuming that the unit of measure is millimeters, set all margins (from now on) to 10mm:
58
55
  .Do CommandLine
59
56
  .incCurrentY %halfLineGap%
60
- .SetVar CommandLine1 .SetMargin All 10
57
+ .SetVar CommandLine1 .SetMargin All 10
61
58
  .Do CommandLine2
62
59
 
63
60
  .incCurrentY %_FontHeight%
64
- .SetVar CommandLine1 Set the left and right margins to 15mm:
61
+ .SetVar CommandLine1 Assuming that the unit of measure is inches, set the left and right margins to 1.2 inch:
65
62
  .Do CommandLine
66
63
  .incCurrentY %halfLineGap%
67
- .SetVar CommandLine1 .SetMargin h 15
64
+ .SetVar CommandLine1 .SetMargin h 1.2
68
65
  .Do CommandLine2
69
66
  .incCurrentY %_FontHeight%
@@ -0,0 +1,43 @@
1
+ .SetVar CommandName SetTextColour
2
+ .Do CommandHeading
3
+ .DrawText 0 %_CurrentY% Set the colour of subsequent text.
4
+
5
+ .SetVar CommandSubHeading Syntax
6
+ .Do CommandSubHeading
7
+ .SetVar CommandLine1 .SetTextColour Colour
8
+ .Do CommandLine2
9
+
10
+ .SetVar CommandSubHeading Parameters
11
+ .Do CommandSubHeading
12
+ .SetVar CommandLine1 Colour
13
+ .SetVar CommandLine2 Either a CSS named colour or a hexadecimal RGB colour.
14
+ .Do CommandLine2
15
+
16
+ .SetVar CommandSubHeading Other
17
+ .Do CommandSubHeading
18
+ .SetVar CommandLine1 The variable _LastResult is set to '1' by this command.
19
+ .Do CommandLine
20
+
21
+ .SetVar CommandSubHeading Examples
22
+ .Do CommandSubHeading
23
+ .SetVar CommandLine1 Set the colour of subsequent text to be brown:
24
+ .Do CommandLine
25
+ .incCurrentY %halfLineGap%
26
+ .SetVar CommandLine1 .SetTextColour Brown
27
+ .Do CommandLine2
28
+
29
+ .incCurrentY %_FontHeight%
30
+ .SetVar CommandLine1 Set the colour of subsequent text to be dark blue:
31
+ .Do CommandLine
32
+ .incCurrentY %halfLineGap%
33
+ .SetVar CommandLine1 .SetVar myColour #00008b
34
+ .Do CommandLine2
35
+ .SetVar CommandLine1 .SetTextColour %%%%myColour%%%%
36
+ .Do CommandLine2
37
+
38
+ .SetVar CommandSubHeading See Also
39
+ .Do CommandSubHeading
40
+ .SetVar CommandLine1 DrawBox, SetFillColour, SetLineColour
41
+ .Do CommandLine
42
+
43
+ .incCurrentY %_FontHeight%
@@ -4,7 +4,7 @@
4
4
 
5
5
  .SetVar CommandSubHeading Syntax
6
6
  .Do CommandSubHeading
7
- .SetVar CommandLine1 .SetVar Variable Value
7
+ .SetVar CommandLine1 .SetVar Variable Value
8
8
  .Do CommandLine2
9
9
 
10
10
  .SetVar CommandSubHeading Parameters
@@ -20,10 +20,10 @@
20
20
  .Do CommandSubHeading
21
21
  .SetVar CommandLine1 Variable _LastResult is set to '1' if a valid variable name is provided, otherwise it is set to '0'.
22
22
  .Do CommandLine
23
+ .incCurrentY %halfLineGap%
23
24
  .SetVar CommandLine1 The JsPdfDynamo maintained variables (those whose name starts with an underscore) can
25
+ .SetVar CommandLine1 %CommandLine1% not be changed using this command.
24
26
  .Do CommandLine
25
- .SetVar CommandLine1 not be changed using this command.
26
- .Do CommandLine
27
27
  .incCurrentY %halfLineGap%
28
28
  .SetVar CommandLine1 To set a variable to blank, omit the value parameter.
29
29
  .Do CommandLine
@@ -36,34 +36,33 @@
36
36
  .SetVar CommandLine1 Set the variable 'Heading' to 'A mighty Good Heading':
37
37
  .Do CommandLine
38
38
  .incCurrentY %halfLineGap%
39
- .SetVar CommandLine1 .SetVar Heading A mighty Good Heading
39
+ .SetVar CommandLine1 .SetVar Heading A mighty Good Heading
40
40
  .Do CommandLine2
41
41
  .incCurrentY %_FontHeight%
42
42
 
43
43
  .SetVar CommandLine1 Save the current vertical position on the page in the variable 'top':
44
44
  .Do CommandLine
45
45
  .incCurrentY %halfLineGap%
46
- .SetVar CommandLine1 .SetVar Top %%%%_CurrentY%%%%
46
+ .SetVar CommandLine1 .SetVar Top %%%%_CurrentY%%%%
47
47
  .Do CommandLine2
48
48
  .incCurrentY %_FontHeight%
49
49
 
50
50
  .SetVar CommandLine1 Set the variable 'Index' to '3':
51
51
  .Do CommandLine
52
52
  .incCurrentY %halfLineGap%
53
- .SetVar CommandLine1 .SetVar Index 3
53
+ .SetVar CommandLine1 .SetVar Index 3
54
54
  .Do CommandLine2
55
55
  .incCurrentY %_FontHeight%
56
56
 
57
57
  .SetVar CommandLine1 Set the variable 'Item7' to the current value of the variable 'Description', given that the
58
- .Do CommandLine
59
- .SetVar CommandLine1 variable 'CurrentItem' has the value of '7':
58
+ .SetVar CommandLine1 %CommandLine1% variable 'CurrentItem' has the value of '7':
60
59
  .Do CommandLine
61
60
  .incCurrentY %halfLineGap%
62
- .SetVar CommandLine1 .SetVar Item%%%%CurrentItem%%%% %%%%Description%%%%
61
+ .SetVar CommandLine1 .SetVar Item%%%%CurrentItem%%%% %%%%Description%%%%
63
62
  .Do CommandLine2
64
63
 
65
64
  .SetVar CommandSubHeading See Also
66
65
  .Do CommandSubHeading
67
- .SetVar CommandLine1 CopyVar, IncVar, MultVar
66
+ .SetVar CommandLine1 CopyVar, DivVar, IncVar, MultVar
68
67
  .Do CommandLine2
69
68
  .incCurrentY %_FontHeight%
@@ -0,0 +1,56 @@
1
+ .SetVar CommandName WriteLog
2
+ .Do CommandHeading
3
+ .SetVar CommandLine1 Writes a message to the logger with the given severity level.
4
+ .Do CommandLine
5
+
6
+ .SetVar CommandSubHeading Syntax
7
+ .Do CommandSubHeading
8
+ .SetVar CommandLine1 .WriteLog severity message
9
+ .Do CommandLine2
10
+
11
+ .SetVar CommandSubHeading Parameters
12
+ .Do CommandSubHeading
13
+ .SetVar CommandLine1 severity
14
+ .SetVar CommandLine2 The severity of the message expressed as either a number (0-4) or as text
15
+ .SetVar CommandLine2 %CommandLine2% (trace, debug, info, warn, error).
16
+ .Do CommandLine2
17
+ .SetVar CommandLine1 message
18
+ .SetVar CommandLine2 The message to be written.
19
+ .Do CommandLine2
20
+
21
+ .SetVar CommandSubHeading Other
22
+ .Do CommandSubHeading
23
+ .SetVar CommandLine1 The variable _LastResult is not changed by this command.
24
+ .Do CommandLine
25
+ .incCurrentY %halfLineGap%
26
+ .SetVar CommandLine1 The output of the message is dependent on the minimum log level of the (optional) logger
27
+ .SetVar CommandLine1 %CommandLine1% passed into the JsPdfDynamo object on creation, and the current
28
+ .SetVar CommandLine1 %CommandLine1% minimum log level set by the SetLogLevel command.
29
+ .Do CommandLine
30
+ .incCurrentY %halfLineGap%
31
+ .SetVar CommandLine1 The initial minimum log level of the JsPdfDynamo class is 'info'.
32
+ .Do CommandLine
33
+
34
+ .SetVar CommandSubHeading Examples
35
+ .Do CommandSubHeading
36
+ .SetVar CommandLine1 Write an informational message:
37
+ .Do CommandLine
38
+ .incCurrentY %halfLineGap%
39
+ .SetVar CommandLine1 .WriteLog info Job completed!
40
+ .Do CommandLine2
41
+
42
+ .incCurrentY %_FontHeight%
43
+ .SetVar CommandLine1 Write a debug message showing the current value of the variable 'amount':
44
+ .Do CommandLine
45
+ .incCurrentY %halfLineGap%
46
+ .SetVar CommandLine1 .SetLogLevel debug
47
+ .Do CommandLine2
48
+ .SetVar CommandLine1 .WriteLog debug The current amount is %%%%amount%%%%
49
+ .Do CommandLine2
50
+
51
+ .SetVar CommandSubHeading See Also
52
+ .Do CommandSubHeading
53
+ .SetVar CommandLine1 SetLogLevel
54
+ .Do CommandLine
55
+
56
+ .incCurrentY %_FontHeight%