jspdf-dynamo 1.0.4 → 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 (33) hide show
  1. package/dist/index.cjs +74 -19
  2. package/dist/index.d.cts +4 -3
  3. package/dist/index.d.ts +4 -3
  4. package/dist/index.js +74 -19
  5. package/documentation/3. Variables/SystemMaintained.txt +5 -0
  6. package/documentation/4. Commands/AddBookmark.txt +1 -1
  7. package/documentation/4. Commands/AddPage.txt +5 -3
  8. package/documentation/4. Commands/CheckPage.txt +1 -1
  9. package/documentation/4. Commands/CopyVar.txt +2 -2
  10. package/documentation/4. Commands/DivVar.txt +67 -0
  11. package/documentation/4. Commands/Do.txt +1 -1
  12. package/documentation/4. Commands/DoRepeat.txt +1 -1
  13. package/documentation/4. Commands/DrawBox.txt +1 -1
  14. package/documentation/4. Commands/DrawDebugGrid.txt +1 -1
  15. package/documentation/4. Commands/DrawImage.txt +2 -2
  16. package/documentation/4. Commands/DrawLine.txt +1 -1
  17. package/documentation/4. Commands/ForEachPage.txt +1 -1
  18. package/documentation/4. Commands/IfEq.txt +53 -0
  19. package/documentation/4. Commands/IfGt.txt +1 -1
  20. package/documentation/4. Commands/IncCurrentX.txt +1 -1
  21. package/documentation/4. Commands/IncCurrentY.txt +1 -1
  22. package/documentation/4. Commands/IncVar.txt +1 -1
  23. package/documentation/4. Commands/{AddImageFromFile.txt → LoadImageFromFile.txt } +4 -4
  24. package/documentation/4. Commands/{AddImageFromUrl.txt → LoadImageFromUrl.txt } +4 -4
  25. package/documentation/4. Commands/MultVar.txt +4 -7
  26. package/documentation/4. Commands/SetCurrentX.txt +1 -1
  27. package/documentation/4. Commands/SetCurrentY.txt +1 -1
  28. package/documentation/4. Commands/SetLineWidth.txt +6 -6
  29. package/documentation/4. Commands/SetMargin.txt +10 -13
  30. package/documentation/4. Commands/SetVar.txt +2 -3
  31. package/documentation/Documentation.pdf +2506 -2038
  32. package/documentation/documentation.txt +4 -2
  33. package/package.json +1 -1
@@ -0,0 +1,53 @@
1
+ .SetVar CommandName IfEq
2
+ .Do CommandHeading
3
+ .SetVar text Compares two variables and if the first one is equal to the second then process a given command. This can be used
4
+ .SetVar text %text% to process one or more groups of commands using the 'do' command or perform some other action, such
5
+ .SetVar text %text% as setting the value of a variable. If either of the variables are not numbers then a string comparison is made.
6
+ .DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %text%
7
+
8
+ .SetVar CommandSubHeading Syntax
9
+ .Do CommandSubHeading
10
+ .SetVar CommandLine1 .IfEq Value1 Value2 Command
11
+ .Do CommandLine2
12
+
13
+ .SetVar CommandSubHeading Parameters
14
+ .Do CommandSubHeading
15
+ .SetVar CommandLine1 Value1,
16
+ .SetVar CommandLine2 The values to compare. These can either be constants or values of
17
+ .Do CommandLine2
18
+ .SetVar CommandLine1 Value2
19
+ .SetVar CommandLine2 variables using substitution.
20
+ .Do CommandLine2
21
+ .SetVar CommandLine1 Command
22
+ .SetVar CommandLine2 The command to execute if the first value is greater than the second.
23
+ .Do CommandLine2
24
+
25
+ .SetVar CommandSubHeading Other
26
+ .Do CommandSubHeading
27
+ .SetVar text The variable _LastResult is set to '0' if the first variable is not equal to the second, otherwise
28
+ .SetVar text %text% _LastResult is set to the result of the last command processed by this command.
29
+ .DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %text%
30
+ .incCurrentY %HalfFontHeight%
31
+ .SetVar text Comparison of string values is case sensitive.
32
+ .DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %text%
33
+
34
+ .SetVar CommandSubHeading Examples
35
+ .Do CommandSubHeading
36
+ .SetVar text Set the value of variable 'finished' to 'true' when the values of variables 'counter' and 'maxCounter' are equal.
37
+ .DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %text%
38
+ .Do CommandLine2
39
+ .SetVar CommandLine1 .IfEq %%%%counter%%%% %%%%maxCounter%%%% .SetVar finished true
40
+ .Do CommandLine2
41
+
42
+ .incCurrentY %_FontHeight%
43
+ .SetVar LongText Process the groups 'OutputTotals' and 'EndDocument' if the value of the variable 'finished' is 'true'.
44
+ .DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %LongText%
45
+ .incCurrentY %halfLineGap%
46
+ .SetVar CommandLine1 .IfEq %%%%finished%%%% true .Do OutputTotals EndDocument
47
+ .Do CommandLine2
48
+
49
+ .SetVar CommandSubHeading See Also
50
+ .Do CommandSubHeading
51
+ .SetVar CommandLine1 IfBlank, IfGt, IfNotBlank
52
+ .Do CommandLine2
53
+ .incCurrentY %_FontHeight%
@@ -53,6 +53,6 @@
53
53
 
54
54
  .SetVar CommandSubHeading See Also
55
55
  .Do CommandSubHeading
56
- .SetVar CommandLine1 IfBlank, IfNotBlank
56
+ .SetVar CommandLine1 IfBlank, IfEq, IfNotBlank
57
57
  .Do CommandLine2
58
58
  .incCurrentY %_FontHeight%
@@ -5,7 +5,7 @@
5
5
 
6
6
  .SetVar CommandSubHeading Syntax
7
7
  .Do CommandSubHeading
8
- .SetVar CommandLine1 .incCurrentX Value Value (etc)
8
+ .SetVar CommandLine1 .incCurrentX Value Value (etc)
9
9
  .Do CommandLine2
10
10
 
11
11
  .SetVar CommandSubHeading Parameters
@@ -5,7 +5,7 @@
5
5
 
6
6
  .SetVar CommandSubHeading Syntax
7
7
  .Do CommandSubHeading
8
- .SetVar CommandLine1 .incCurrentY Value Value (etc)
8
+ .SetVar CommandLine1 .incCurrentY Value Value (etc)
9
9
  .Do CommandLine2
10
10
 
11
11
  .SetVar CommandSubHeading Parameters
@@ -68,6 +68,6 @@
68
68
 
69
69
  .SetVar CommandSubHeading See Also
70
70
  .Do CommandSubHeading
71
- .SetVar CommandLine1 CopyVar, MultVar, SetVar
71
+ .SetVar CommandLine1 CopyVar, DivVar, MultVar, SetVar
72
72
  .Do CommandLine2
73
73
  .incCurrentY %_FontHeight%
@@ -1,4 +1,4 @@
1
- .SetVar CommandName AddImageFromFile (NodeJs Only)
1
+ .SetVar CommandName LoadImageFromFile (NodeJs Only)
2
2
  .Do CommandHeading
3
3
  .SetVar text Reads an image from the file system and stores it for later output. JsPdfDynamo can use all image types
4
4
  .SetVar text %text% that jsPDF supports, including: BMP, GIF, JPEG, PNG, TIFF and WEBP
@@ -7,7 +7,7 @@
7
7
 
8
8
  .SetVar CommandSubHeading Syntax
9
9
  .Do CommandSubHeading
10
- .SetVar CommandLine1 .AddImageFromFile FileName
10
+ .SetVar CommandLine1 .LoadImageFromFile FileName
11
11
  .Do CommandLine2
12
12
 
13
13
  .SetVar CommandSubHeading Parameters
@@ -44,7 +44,7 @@
44
44
  .SetVar CommandLine1 Read a logo from an image and add it to the top left of the current page.
45
45
  .Do CommandLine
46
46
  .incCurrentY %halfLineGap%
47
- .SetVar CommandLine1 .AddImageFromFile ../images/myLogo.jpg
47
+ .SetVar CommandLine1 .LoadImageFromFile ../images/myLogo.jpg
48
48
  .Do CommandLine2
49
49
  .SetVar CommandLine1 .SetVar IdLogo %%%%_LastImageAdded%%%%
50
50
  .Do CommandLine2
@@ -54,6 +54,6 @@
54
54
 
55
55
  .SetVar CommandSubHeading See Also
56
56
  .Do CommandSubHeading
57
- .SetVar CommandLine1 AddImageFromUrl, DrawImage
57
+ .SetVar CommandLine1 DrawImage, LoadImageFromUrl
58
58
  .Do CommandLine2
59
59
  .incCurrentY %_FontHeight%
@@ -1,4 +1,4 @@
1
- .SetVar CommandName AddImageFromUrl (Browser Only)
1
+ .SetVar CommandName LoadImageFromUrl (Browser Only)
2
2
  .Do CommandHeading
3
3
  .SetVar text Reads an image from the given URL and stores it for later output. JsPdfDynamo can use all image types
4
4
  .SetVar text %text% that jsPDF supports, including: BMP, GIF, JPEG, PNG, TIFF and WEBP
@@ -7,7 +7,7 @@
7
7
 
8
8
  .SetVar CommandSubHeading Syntax
9
9
  .Do CommandSubHeading
10
- .SetVar CommandLine1 .AddImageFromUrl URL
10
+ .SetVar CommandLine1 .LoadImageFromUrl URL
11
11
  .Do CommandLine2
12
12
 
13
13
  .SetVar CommandSubHeading Parameters
@@ -44,7 +44,7 @@
44
44
  .SetVar CommandLine1 Read a logo from an image and add it to the top left of the current page.
45
45
  .Do CommandLine
46
46
  .incCurrentY %halfLineGap%
47
- .SetVar CommandLine1 .AddImageFromUrl /images/logo.png
47
+ .SetVar CommandLine1 .LoadImageFromUrl /images/logo.png
48
48
  .Do CommandLine2
49
49
  .SetVar CommandLine1 .SetVar IdLogo %%%%_LastImageAdded%%%%
50
50
  .Do CommandLine2
@@ -54,7 +54,7 @@
54
54
 
55
55
  .SetVar CommandSubHeading See Also
56
56
  .Do CommandSubHeading
57
- .SetVar CommandLine1 AddImageFromFile, DrawImage
57
+ .SetVar CommandLine1 DrawImage, LoadImageFromFile
58
58
  .Do CommandLine2
59
59
 
60
60
  .incCurrentY %_FontHeight%
@@ -4,20 +4,17 @@
4
4
 
5
5
  .SetVar CommandSubHeading Syntax
6
6
  .Do CommandSubHeading
7
- .SetVar CommandLine1 .MultVar Variable Value Value (etc)
7
+ .SetVar CommandLine1 .MultVar Variable Value Value (etc)
8
8
  .Do CommandLine2
9
9
 
10
10
  .SetVar CommandSubHeading Parameters
11
11
  .Do CommandSubHeading
12
12
  .SetVar CommandLine1 Variable
13
13
  .SetVar CommandLine2 The name of the variable to update. This is not usually a substitution variable,
14
- .Do CommandLine2
15
- .SetVar CommandLine2 but it can be, or contain substitution variables. The variable must exist.
14
+ .SetVar CommandLine2 %CommandLine2% but it can be, or contain substitution variables. The variable must exist.
16
15
  .Do CommandLine2
17
16
  .SetVar CommandLine1 Value
18
- .SetVar CommandLine2 One or more values to multiple the variable by. These can be constants or
19
- .Do CommandLine2
20
- .SetVar CommandLine2 substitution variables.
17
+ .SetVar CommandLine2 One or more values to multiple the variable by. These can be constants or substitution variables.
21
18
  .Do CommandLine2
22
19
 
23
20
  .SetVar CommandSubHeading Other
@@ -65,6 +62,6 @@
65
62
 
66
63
  .SetVar CommandSubHeading See Also
67
64
  .Do CommandSubHeading
68
- .SetVar CommandLine1 CopyVar, IncVar, SetVar
65
+ .SetVar CommandLine1 CopyVar, DivVar, IncVar, SetVar
69
66
  .Do CommandLine2
70
67
  .incCurrentY %_FontHeight%
@@ -6,7 +6,7 @@
6
6
 
7
7
  .SetVar CommandSubHeading Syntax
8
8
  .Do CommandSubHeading
9
- .SetVar CommandLine1 .setCurrentX Value
9
+ .SetVar CommandLine1 .setCurrentX Value
10
10
  .Do CommandLine2
11
11
 
12
12
  .SetVar CommandSubHeading Parameters
@@ -6,7 +6,7 @@
6
6
 
7
7
  .SetVar CommandSubHeading Syntax
8
8
  .Do CommandSubHeading
9
- .SetVar CommandLine1 .setCurrentY Value
9
+ .SetVar CommandLine1 .setCurrentY Value
10
10
  .Do CommandLine2
11
11
 
12
12
  .SetVar CommandSubHeading Parameters
@@ -4,7 +4,7 @@
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
@@ -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%
@@ -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
@@ -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%
@@ -55,8 +55,7 @@
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
61
  .SetVar CommandLine1 .SetVar Item%%%%CurrentItem%%%% %%%%Description%%%%
@@ -64,6 +63,6 @@
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%