jspdf-dynamo 1.0.4 → 1.0.6

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 (53) hide show
  1. package/README.md +3 -3
  2. package/dist/index.cjs +154 -52
  3. package/dist/index.d.cts +16 -13
  4. package/dist/index.d.ts +16 -13
  5. package/dist/index.js +154 -52
  6. package/documentation/1. Introduction/Introduction.txt +1 -1
  7. package/documentation/3. Variables/Introduction.txt +13 -12
  8. package/documentation/3. Variables/SystemMaintained.txt +45 -0
  9. package/documentation/4. Commands/AddBookmark.txt +1 -1
  10. package/documentation/4. Commands/AddPage.txt +5 -3
  11. package/documentation/4. Commands/CheckPage.txt +1 -1
  12. package/documentation/4. Commands/CopyVar.txt +2 -2
  13. package/documentation/4. Commands/DivVar.txt +67 -0
  14. package/documentation/4. Commands/Do.txt +1 -1
  15. package/documentation/4. Commands/DoRepeat.txt +1 -1
  16. package/documentation/4. Commands/DrawBox.txt +1 -1
  17. package/documentation/4. Commands/DrawDebugGrid.txt +1 -1
  18. package/documentation/4. Commands/DrawImage.txt +2 -2
  19. package/documentation/4. Commands/DrawLine.txt +1 -1
  20. package/documentation/4. Commands/DrawTextWrapped.txt +1 -1
  21. package/documentation/4. Commands/ForEachPage.txt +1 -1
  22. package/documentation/4. Commands/IfBlank.txt +1 -1
  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 +1 -1
  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 +1 -1
  29. package/documentation/4. Commands/{AddImageFromFile.txt → LoadImageFromFile.txt } +6 -6
  30. package/documentation/4. Commands/{AddImageFromUrl.txt → LoadImageFromUrl.txt } +6 -6
  31. package/documentation/4. Commands/MultVar.txt +4 -7
  32. package/documentation/4. Commands/SetCurrentX.txt +1 -1
  33. package/documentation/4. Commands/SetCurrentY.txt +1 -1
  34. package/documentation/4. Commands/SetFillColour.txt +4 -2
  35. package/documentation/4. Commands/SetFontName.txt +80 -1
  36. package/documentation/4. Commands/SetFontSize.txt +43 -1
  37. package/documentation/4. Commands/SetFontStyle.txt +4 -5
  38. package/documentation/4. Commands/SetLineColour.txt +5 -2
  39. package/documentation/4. Commands/SetLineWidth.txt +6 -6
  40. package/documentation/4. Commands/SetMargin.txt +10 -13
  41. package/documentation/4. Commands/SetTextColour.txt +4 -2
  42. package/documentation/4. Commands/SetVar.txt +2 -3
  43. package/documentation/5. Other Definitions/pageSizes.txt +3 -3
  44. package/documentation/Documentation.pdf +0 -0
  45. package/documentation/documentation.txt +4 -2
  46. package/examples/1.Simple/simple.pdf +18 -186
  47. package/examples/2.Invoice/data.txt +21 -0
  48. package/examples/2.Invoice/gearz.png +0 -0
  49. package/examples/2.Invoice/invoice.pdf +0 -0
  50. package/examples/2.Invoice/invoice.spec.ts +62 -0
  51. package/examples/2.Invoice/parts.json +324 -0
  52. package/examples/2.Invoice/template.txt +136 -0
  53. package/package.json +1 -1
@@ -0,0 +1,136 @@
1
+ [Initialise]
2
+ .SetMargin a 10
3
+ .SetVar MetaPrompt 130
4
+ .SetVar MetaData 155
5
+ .SetSpaceVert 0.7
6
+ .SetLineWidth 0.3
7
+ .SetVar CurrentPage 1
8
+ .SetVar NextPage 2
9
+ [End]
10
+
11
+ [FirstPageHeader]
12
+ .LoadImageFromFile ./examples/2.Invoice/gearz.png
13
+ .SetVar LogoId %_LastImageAdded%
14
+ .DrawImage %LogoId% 0 0 40
15
+ .SetFontSize 24
16
+ .SetFontStyle Bold
17
+ .DrawTextBox 0 0 %_PageWidth% 10 C T %DocumentCaption%
18
+
19
+ .Do MetaData Address
20
+ .SetCurrentY 70
21
+ [End]
22
+
23
+ [MetaData]
24
+ .Do NormalText
25
+ .SetVar top %_CurrentY%
26
+ .DrawText %MetaPrompt% %top% %DocumentType% No:
27
+ .DrawText %MetaData% %top% %DocumentNo%
28
+
29
+ .SetVar top %_CurrentY%
30
+ .DrawText %MetaPrompt% %top% %DocumentType% Date:
31
+ .DrawText %MetaData% %top% %docDate%
32
+
33
+ .SetVar top %_CurrentY%
34
+ .DrawText %MetaPrompt% %top% Customer No:
35
+ .DrawText %MetaData% %top% %CustNo%
36
+
37
+ .SetVar top %_CurrentY%
38
+ .DrawText %MetaPrompt% %top% Reference:
39
+ .DrawText %MetaData% %top% %CustRef%
40
+
41
+ .SetVar pageNoTop %_CurrentY%
42
+ [End]
43
+
44
+ [NumberPages]
45
+ .DrawText %MetaPrompt% %pageNoTop% Page:
46
+ .DrawText %MetaData% %pageNoTop% %_PageNo% of %_Pages%
47
+ [End]
48
+
49
+ [NormalText]
50
+ .SetFontSize 11
51
+ .SetFontStyle Normal
52
+ [End]
53
+
54
+ [Address]
55
+ .SetVar left 10
56
+ .SetVar right 90
57
+ .SetFontSize 9
58
+ .SetVar top 40
59
+ .DrawText 5 %top% %to1%:
60
+ .DrawText 85 %top% %to2%:
61
+
62
+ .do NormalText
63
+ .SetVar top %_CurrentY%
64
+ .DrawText %left% %top% %Name1%
65
+ .ifNotBlank Addr1Line1 .DrawText %left% %_CurrentY% %Addr1Line1%
66
+ .ifNotBlank Addr1Line2 .DrawText %left% %_CurrentY% %Addr1Line2%
67
+ .DrawText %left% %_CurrentY% %City1% %State1% %Zip1%
68
+
69
+ .DrawText %right% %top% %Name2%
70
+ .ifNotBlank Addr2Line1 .DrawText %right% %_CurrentY% %Addr2Line1%
71
+ .ifNotBlank Addr2Line2 .DrawText %right% %_CurrentY% %Addr2Line2%
72
+ .DrawText %right% %_CurrentY% %City2% %State2% %Zip2%
73
+ [End]
74
+
75
+ [Headings]
76
+ .drawLine 0 %_CurrentY% %_PageWidth% %_CurrentY%
77
+ .IncCurrentY %_SpaceVert%
78
+ .setVar top %_CurrentY%
79
+ .DrawText 0 %top% Line
80
+ .DrawText 9 %top% Part No.
81
+ .DrawText 43 %top% Description
82
+ .DrawTextBox 125 %top% 20 %_FontHeight% r t Quantity
83
+ .DrawTextBox 145 %top% 20 %_FontHeight% r t Price
84
+ .DrawTextBox 165 %top% 20 %_FontHeight% r t Extended
85
+ .IncCurrentY %_SpaceVert%
86
+ .drawLine 0 %_CurrentY% %_PageWidth% %_CurrentY%
87
+ [End]
88
+
89
+ [CheckPage]
90
+ .CheckPage 15 NextPage
91
+ [End]
92
+
93
+ [NextPage]
94
+ .IncCurrentY %_SpaceVert%
95
+ .DrawLine 0 %_CurrentY% %_PageWidth% %_CurrentY%
96
+ .IncCurrentY %_SpaceVert%
97
+ .DrawTextBox 0 %_CurrentY% %_PageWidth% %_FontHeight% c t Continued on page %NextPage%
98
+ .IncVar NextPage 1
99
+ .AddPage
100
+ .SetFontSize 24
101
+ .SetFontStyle Bold
102
+ .DrawTextBox 0 0 %_PageWidth% 10 C T %DocumentCaption% - Continued
103
+ .Do MetaData
104
+ .IncCurrentY %_FontHeight% %_FontHeight%
105
+ .Do Headings
106
+ .IncCurrentY %_SpaceVert%
107
+ .DrawTextBox 0 %_CurrentY% %_PageWidth% %_FontHeight% c t Continued from page %CurrentPage%
108
+ .IncVar CurrentPage 1
109
+ [End]
110
+
111
+ [AddPart]
112
+ .Do CheckPage
113
+ .setVar top %_CurrentY%
114
+ .DrawTextBox 0 %top% 6 %_FontHeight% r t %ix%
115
+ .DrawText 9 %top% %PartNo%
116
+ .DrawTextWrapped 43 %top% 80 CheckPage %Description%
117
+ .SetVar NextTop %_CurrentY%
118
+ .DrawTextBox 125 %top% 20 %_FontHeight% r t %Qty%
119
+ .DrawTextBox 145 %top% 20 %_FontHeight% r t %Price%
120
+ .DrawTextBox 165 %top% 20 %_FontHeight% r t %total%
121
+ .SetCurrentY %NextTop%
122
+ [End]
123
+
124
+ [Totals]
125
+ .Do CheckPage
126
+ .IncCurrentY %_SpaceVert%
127
+ .DrawLine 0 %_CurrentY% %_PageWidth% %_CurrentY%
128
+ .IncCurrentY %_SpaceVert%
129
+ .setVar top %_CurrentY%
130
+ .DrawTextBox 43 %top% 80 %_FontHeight% r t %DocumentType% Totals
131
+ .SetFontStyle Bold
132
+ .DrawTextBox 165 %top% 20 %_FontHeight% r t %total%
133
+ .IncCurrentY %_SpaceVert%
134
+ .DrawLine 0 %_CurrentY% %_PageWidth% %_CurrentY%
135
+ .Do NormalText
136
+ [End]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jspdf-dynamo",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Generate data driven PDFs from dynamic templates",
5
5
  "main": "dist/index.js",
6
6
  "repository": {