jspdf-dynamo 1.0.0 → 1.0.1
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.
- package/dist/index.cjs +5 -7
- package/dist/index.js +5 -7
- package/documentation/1. Introduction/Introduction.txt +2 -2
- package/documentation/4. Commands/AddImageFromUrl.txt +1 -4
- package/documentation/4. Commands/Include.txt +15 -14
- package/documentation/4. Commands/IncludeUrl.txt +11 -0
- package/documentation/4. Commands/SetFontSize.txt +0 -18
- package/documentation/4. Commands/SetFontStyle.txt +28 -10
- package/documentation/4. Commands/SetLineColour.txt +1 -1
- package/documentation/Documentation.pdf +1215 -1234
- package/documentation/documentation.txt +13 -3
- package/examples/1.Simple/simple.pdf +2 -2
- package/package.json +10 -4
- package/documentation/6. Other/PossibleEnhancements.txt +0 -63
- package/documentation/6. Other/To Be Documented.txt +0 -50
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
.SetVar halfLineGap 2.0
|
|
16
16
|
.SetLineColor %black%
|
|
17
17
|
|
|
18
|
-
.Do SetDefaultText
|
|
19
18
|
.SetVar margins 15
|
|
20
19
|
.SetVar marginB %margins%
|
|
21
20
|
.IncVar marginB %_FONTHEIGHT% 0.1
|
|
@@ -57,6 +56,8 @@
|
|
|
57
56
|
.SetVar top %_PageHeight%
|
|
58
57
|
.MultVar top 0.3
|
|
59
58
|
.DrawTextBox 0 %top% %_PageWidth% %_FontHeight% centered top jsPdf-Dynamo
|
|
59
|
+
.DrawTextBox 0 %_CurrentY% %_PageWidth% %_FontHeight% centered top (Draft)
|
|
60
|
+
.incCurrentY 2
|
|
60
61
|
.SetFontSize 24
|
|
61
62
|
.SetTextColour %black%
|
|
62
63
|
.DrawTextBox 0 %_CurrentY% %_PageWidth% %_FontHeight% centered top User Guide
|
|
@@ -82,6 +83,12 @@
|
|
|
82
83
|
[Footer]
|
|
83
84
|
.SetVar top %_PageHeight%
|
|
84
85
|
.incVar top -%_FontHeight%
|
|
86
|
+
.setMargin t 7
|
|
87
|
+
.setFontStyle Bold
|
|
88
|
+
.setFontSize 18
|
|
89
|
+
.SetTextColour red
|
|
90
|
+
.ifGt %_PageNo% 1 .DrawTextBox 0 0 %_PageWidth% 8 centered centered *** Draft ***
|
|
91
|
+
.Do SetDefaultText
|
|
85
92
|
.ifGt %_PageNo% 1 .DrawTextBox 0 %top% %_PageWidth% %_FontHeight% centered centered Page %_PageNo% of %LastPage%
|
|
86
93
|
[End]
|
|
87
94
|
|
|
@@ -138,13 +145,15 @@
|
|
|
138
145
|
.IncVar cl1Width -5
|
|
139
146
|
.SetVar cl1bWidth %_PageWidth%
|
|
140
147
|
.IncVar cl1bWidth -10
|
|
148
|
+
.SetVar cl1cWidth %_PageWidth%
|
|
149
|
+
.IncVar cl1cWidth -15
|
|
141
150
|
.SetVar cl2Width %_PageWidth%
|
|
142
151
|
.IncVar cl2Width -33
|
|
143
152
|
.SetVar cl3Width %_PageWidth%
|
|
144
153
|
.IncVar cl3Width -35
|
|
145
154
|
.ifNotBlank CommandLine1 .DrawTextWrapped 5 %top% %cl1Width% CommandCheckPage %CommandLine1%
|
|
146
155
|
.ifNotBlank CommandLine1b .DrawTextWrapped 10 %top% %cl1bWidth% CommandCheckPage %CommandLine1b%
|
|
147
|
-
.ifNotBlank CommandLine1c .
|
|
156
|
+
.ifNotBlank CommandLine1c .DrawTextWrapped 15 %top% %cl1cWidth% CommandCheckPage %CommandLine1c%
|
|
148
157
|
.ifNotBlank CommandLine2 .DrawTextWrapped 33 %top% %cl2Width% CommandCheckPage %CommandLine2%
|
|
149
158
|
.ifNotBlank CommandLine3 .DrawTextWrapped 35 %top% %cl3Width% CommandCheckPage %CommandLine3%
|
|
150
159
|
.SetVar CommandLine1
|
|
@@ -189,7 +198,7 @@
|
|
|
189
198
|
.SetVar CommandLine2
|
|
190
199
|
[End]
|
|
191
200
|
|
|
192
|
-
.do SetMargins TitlePage
|
|
201
|
+
.do SetMargins TitlePage SetDefaultText
|
|
193
202
|
.SetDocumentInfo Title jsPdf-Dynamo Developer's Documentation
|
|
194
203
|
.SetDocumentInfo Author Stephen Corbett
|
|
195
204
|
.SetDocumentInfo Creator jsPdf-Dynamo
|
|
@@ -232,6 +241,7 @@
|
|
|
232
241
|
.Include ./Documentation/4. Commands/incCurrentX.txt
|
|
233
242
|
.Include ./Documentation/4. Commands/incCurrentY.txt
|
|
234
243
|
.Include ./Documentation/4. Commands/Include.txt
|
|
244
|
+
.Include ./Documentation/4. Commands/IncludeUrl.txt
|
|
235
245
|
.Include ./Documentation/4. Commands/IncVar.txt
|
|
236
246
|
.Include ./Documentation/4. Commands/MultVar.txt
|
|
237
247
|
.Include ./Documentation/4. Commands/setCurrentX.txt
|
|
@@ -201,7 +201,7 @@ endobj
|
|
|
201
201
|
19 0 obj
|
|
202
202
|
<<
|
|
203
203
|
/Producer (jsPDF 2.5.2)
|
|
204
|
-
/CreationDate (D:
|
|
204
|
+
/CreationDate (D:20240924091503+10'00')
|
|
205
205
|
>>
|
|
206
206
|
endobj
|
|
207
207
|
20 0 obj
|
|
@@ -240,7 +240,7 @@ trailer
|
|
|
240
240
|
/Size 21
|
|
241
241
|
/Root 20 0 R
|
|
242
242
|
/Info 19 0 R
|
|
243
|
-
/ID [ <
|
|
243
|
+
/ID [ <BFEC21AB9E25DABE2D2409F6AA5BDFBD> <BFEC21AB9E25DABE2D2409F6AA5BDFBD> ]
|
|
244
244
|
>>
|
|
245
245
|
startxref
|
|
246
246
|
2736
|
package/package.json
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jspdf-dynamo",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Generate data driven PDFs from dynamic templates",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/SteveCorbett/jsPdf-Dynamo"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/SteveCorbett/jsPdf-Dynamo/issues"
|
|
12
|
+
},
|
|
6
13
|
"scripts": {
|
|
7
14
|
"build": "tsup",
|
|
8
15
|
"build-docs": "vitest --dir ./documentation run",
|
|
@@ -23,11 +30,10 @@
|
|
|
23
30
|
"template",
|
|
24
31
|
"typescript"
|
|
25
32
|
],
|
|
26
|
-
"author": "Stephen Corbett",
|
|
33
|
+
"author": "Stephen Corbett <corbett@corbtech.com.au> (https://corbtech.com.au)",
|
|
27
34
|
"license": "MIT",
|
|
28
35
|
"dependencies": {
|
|
29
|
-
"jspdf": "^2.5.1"
|
|
30
|
-
"node-fetch": "^3.3.2"
|
|
36
|
+
"jspdf": "^2.5.1"
|
|
31
37
|
},
|
|
32
38
|
"devDependencies": {
|
|
33
39
|
"@arethetypeswrong/cli": "^0.15.4",
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
.SetVar ChapterName Possible Enhancements
|
|
2
|
-
.do ChapterHeading
|
|
3
|
-
|
|
4
|
-
.SetVar CommandLine1 The following is a list of possible enhancements to JsPdfDynamo:
|
|
5
|
-
.Do CommandLine
|
|
6
|
-
.incCurrentY %_FontHeight%
|
|
7
|
-
|
|
8
|
-
.SetVar CommandLine1 * Add an option to DrawDebugGrid to draw the grid within the page margins.
|
|
9
|
-
.Do CommandLine2
|
|
10
|
-
|
|
11
|
-
.SetVar CommandLine1 * Add an option to leave the current group.
|
|
12
|
-
.Do CommandLine2
|
|
13
|
-
|
|
14
|
-
.SetVar CommandLine1 * Implement more user friendly options, For example L, Left, C, Center, T, Top
|
|
15
|
-
.Do CommandLine2
|
|
16
|
-
.SetVar CommandLine1 for horizontal alignment within DrawTextBox.
|
|
17
|
-
.Do CommandLine2
|
|
18
|
-
|
|
19
|
-
.SetVar CommandLine1 * Display the examples in this document as 'code'. Ie Within a shaded box in a fixed font
|
|
20
|
-
.Do CommandLine2
|
|
21
|
-
|
|
22
|
-
.SetVar CommandLine1 * Have the ability to add highlighted URL links
|
|
23
|
-
.Do CommandLine2
|
|
24
|
-
|
|
25
|
-
.SetVar CommandLine1 * Pass parameters into commands. ie. .Do MyCommands(123 456 SomeText)
|
|
26
|
-
.Do CommandLine2
|
|
27
|
-
|
|
28
|
-
.SetVar CommandLine1 * Have all fumctions set the value of LastError. This also causes errors to be logged.
|
|
29
|
-
.Do CommandLine2
|
|
30
|
-
|
|
31
|
-
.incCurrentY %_FontHeight%
|
|
32
|
-
.SetVar CommandLine1 In addition, other clsDoPdf functions should be implemented, including:
|
|
33
|
-
.Do CommandLine
|
|
34
|
-
.incCurrentY %halfLineGap%
|
|
35
|
-
|
|
36
|
-
.SetVar CommandLine1 * IfZero, IfNeZero, IfEq, IfNE: Conditional calcs, etc
|
|
37
|
-
.Do CommandLine2
|
|
38
|
-
|
|
39
|
-
.SetVar CommandLine1 * Including fonts
|
|
40
|
-
.Do CommandLine2
|
|
41
|
-
|
|
42
|
-
.SetVar CommandLine1 * Including pictures
|
|
43
|
-
.Do CommandLine2
|
|
44
|
-
|
|
45
|
-
.SetVar CommandLine1 * Including input fields
|
|
46
|
-
.Do CommandLine2
|
|
47
|
-
|
|
48
|
-
.SetVar CommandLine1 * Including existing documents
|
|
49
|
-
.Do CommandLine2
|
|
50
|
-
|
|
51
|
-
.SetVar CommandLine1 * The dump command to list out all variable values
|
|
52
|
-
.Do CommandLine2
|
|
53
|
-
.SetVar LongText Note that the dump command could output to the logger. It would then be up to the calling program to provide some method of making that
|
|
54
|
-
.SetVar LongText %LongText% visible. For example, for a web page, there could be an endpoint, or option, that returns just the debug information.
|
|
55
|
-
.DrawTextWrapped 0 %_CurrentY% %_PageWidth% CommandCheckPage %LongText%
|
|
56
|
-
|
|
57
|
-
.incCurrentY %_FontHeight%
|
|
58
|
-
.SetVar CommandLine1 Additional system maintained variables:
|
|
59
|
-
.Do CommandLine
|
|
60
|
-
.incCurrentY %halfLineGap%
|
|
61
|
-
|
|
62
|
-
.SetVar CommandLine1 * CurrentFontStyle so it can be restored after a page overflow
|
|
63
|
-
.Do CommandLine2
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
.SetVar ChapterName To Be Documented
|
|
2
|
-
.do ChapterHeading
|
|
3
|
-
|
|
4
|
-
.DrawText 0 %_CurrentY% We definitely need to describe the 'groups of commands' and how they work. Maybe they
|
|
5
|
-
.DrawText 0 %_CurrentY% should be referred to as 'macros'?
|
|
6
|
-
.incCurrentY %halfLineGap%
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
.DrawText 0 %_CurrentY% There's a few methods not currently documented, sorry! Here's a partial list of them.
|
|
10
|
-
.incCurrentY %halfLineGap%
|
|
11
|
-
|
|
12
|
-
.SetVar Indent 5
|
|
13
|
-
.SetVar MaxWidth %_PageWidth%
|
|
14
|
-
.IncVar MaxWidth -%Indent%
|
|
15
|
-
.SetVar LongText * The JsPdfDynamo constructor.
|
|
16
|
-
.DrawTextWrapped %Indent% %_CurrentY% %MaxWidth% CommandCheckPage %LongText%
|
|
17
|
-
|
|
18
|
-
.SetVar CommandLine1 * The .AddImageFromFile/Url, DrawImage commands
|
|
19
|
-
.Do CommandLine2
|
|
20
|
-
|
|
21
|
-
.incCurrentY %halfLineGap%
|
|
22
|
-
.SetVar CommandLine1 AddImageFromFile sets _LastError, _LastResult & _LastImageAdded
|
|
23
|
-
.Do CommandLine2
|
|
24
|
-
.SetVar CommandLine1 AddImageFromUrl sets _LastError, _LastResult & _LastImageAdded
|
|
25
|
-
.Do CommandLine2
|
|
26
|
-
.SetVar CommandLine1 DrawImage imageId left top %scale (default=1 full size)
|
|
27
|
-
.Do CommandLine2
|
|
28
|
-
|
|
29
|
-
.incCurrentY %halfLineGap%
|
|
30
|
-
.SetVar CommandLine1 * The .SavePdf command
|
|
31
|
-
.Do CommandLine2
|
|
32
|
-
|
|
33
|
-
.SetVar CommandLine1 * The .SetTextColour, .SetFontName and .SetFontSize commands
|
|
34
|
-
.Do CommandLine2
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
.incCurrentY %_FontHeight%
|
|
39
|
-
.SetVar CommandLine1 The file TempDoco.txt contains descriptions of some of this missing documentation.
|
|
40
|
-
.Do CommandLine
|
|
41
|
-
|
|
42
|
-
.incCurrentY %_FontHeight%
|
|
43
|
-
.SetVar CommandLine1 Some complete script examples would be useful
|
|
44
|
-
.Do CommandLine
|
|
45
|
-
|
|
46
|
-
.incCurrentY %_FontHeight%
|
|
47
|
-
.SetVar CommandLine1 Having examples in a fixed font within a shaded box would also be an improvement.
|
|
48
|
-
.Do CommandLine
|
|
49
|
-
|
|
50
|
-
.incCurrentY %_FontHeight%
|