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
package/dist/index.cjs CHANGED
@@ -352,6 +352,11 @@ var JsPdfProcessor = class {
352
352
  })
353
353
  );
354
354
  this._variables.set("_DATEDMY", (/* @__PURE__ */ new Date()).toLocaleDateString("en-GB"));
355
+ this._variables.set("_IMAGEASPECT", "1");
356
+ this._variables.set("_IMAGEHEIGHT", "0");
357
+ this._variables.set("_IMAGEHEIGHTPX", "0");
358
+ this._variables.set("_IMAGEWIDTH", "0");
359
+ this._variables.set("_IMAGEWIDTHPX", "0");
355
360
  this._variables.set("_PAGENO", "1");
356
361
  this._variables.set("_PAGES", "1");
357
362
  this.posnX = 0;
@@ -716,8 +721,8 @@ var JsPdfProcessor = class {
716
721
  this.pageWidth = document.internal.pageSize.width - this._marginLeft - this._marginRight;
717
722
  }
718
723
  }
719
- addImageFromFile(input) {
720
- const subs = this.logAndParseCommand(".addImageFromFile", input);
724
+ LoadImageFromFile(input) {
725
+ const subs = this.logAndParseCommand(".LoadImageFromFile", input);
721
726
  let fileName = subs;
722
727
  if (!fileName) {
723
728
  this.lastError = "A file name is required.";
@@ -738,9 +743,9 @@ var JsPdfProcessor = class {
738
743
  this.lastResult = "0";
739
744
  }
740
745
  }
741
- addImageFromUrl(input) {
746
+ LoadImageFromUrl(input) {
742
747
  return __async(this, null, function* () {
743
- const subs = this.logAndParseCommand(".addImageFromUrl", input);
748
+ const subs = this.logAndParseCommand(".LoadImageFromUrl", input);
744
749
  let url = subs;
745
750
  if (!url) {
746
751
  this.lastError = "A URL is required.";
@@ -783,6 +788,10 @@ var JsPdfProcessor = class {
783
788
  this.setFixedDec(this.pixelsToUom(info.height), 3)
784
789
  );
785
790
  this._variables.set("_IMAGEHEIGHTPX", info.height.toString());
791
+ this._variables.set(
792
+ "_IMAGEASPECT",
793
+ info.height > 0 ? this.setFixedDec(info.width / info.height, 3) : "1"
794
+ );
786
795
  }
787
796
  getContentType(fileName) {
788
797
  const mediaType = fileName.split(".").pop();
@@ -1396,6 +1405,51 @@ var JsPdfProcessor = class {
1396
1405
  "Variable " + varName + " incremented to " + this._variables.get(varName)
1397
1406
  );
1398
1407
  }
1408
+ divVar(input) {
1409
+ let subs = this.substitute(input.trim());
1410
+ this._logger.debug(".divVar " + subs);
1411
+ let { first: varName, rest } = getNextString(subs.toLocaleUpperCase());
1412
+ if (varName === "") {
1413
+ this.lastResult = "0";
1414
+ this.lastError = "DivVar must reference a variable";
1415
+ return;
1416
+ }
1417
+ if (varName.startsWith("_")) {
1418
+ this.lastResult = "0";
1419
+ this.lastError = "DivVar can not be used to update system maintained variables";
1420
+ return;
1421
+ }
1422
+ let varValue = this._variables.get(varName);
1423
+ if (!varValue) {
1424
+ this.lastResult = "0";
1425
+ this.lastError = "Variable '" + varName + "' is not defined";
1426
+ return;
1427
+ }
1428
+ if (isNaN(Number(varValue))) {
1429
+ this._variables.set(varName, "0");
1430
+ }
1431
+ while (rest.length > 0) {
1432
+ const { first: nextOp, rest: remainder } = getNextNumber(rest, 4);
1433
+ rest = remainder;
1434
+ let varValue2 = this._variables.get(varName);
1435
+ if (!isNaN(Number(nextOp)) && Number(nextOp) === 0) {
1436
+ this.lastResult = "0";
1437
+ this.lastError = "Divide by zero error";
1438
+ return;
1439
+ }
1440
+ if (!isNaN(Number(varValue2)) && !isNaN(Number(nextOp))) {
1441
+ this._variables.set(
1442
+ varName,
1443
+ removeTrailingZeros((Number(varValue2) / Number(nextOp)).toFixed(4))
1444
+ );
1445
+ }
1446
+ varValue2 = this._variables.get(varName);
1447
+ }
1448
+ this.lastResult = "1";
1449
+ this._logger.trace(
1450
+ "Variable " + varName + " incremented to " + this._variables.get(varName)
1451
+ );
1452
+ }
1399
1453
  multVar(input) {
1400
1454
  let subs = this.substitute(input.trim());
1401
1455
  this._logger.debug(".multVar " + subs);
@@ -1844,11 +1898,9 @@ var JsPdfDynamo = class {
1844
1898
  return null;
1845
1899
  }
1846
1900
  }
1847
- toBlobUrl(fileName) {
1901
+ toBlobUrl() {
1848
1902
  try {
1849
- const result = this._processor.PdfDocument.output("bloburi", {
1850
- filename: fileName
1851
- });
1903
+ const result = this._processor.PdfDocument.output("bloburi");
1852
1904
  return result;
1853
1905
  } catch (e) {
1854
1906
  __privateGet(this, _appLogger).warn(
@@ -1879,7 +1931,7 @@ var JsPdfDynamo = class {
1879
1931
  }
1880
1932
  processTemplate(processor, input) {
1881
1933
  return __async(this, null, function* () {
1882
- let inGroupProcessing = false;
1934
+ let inGroupLoading = false;
1883
1935
  let grpName = "";
1884
1936
  let currGroup = [];
1885
1937
  for (let ix = 0; ix < input.length; ix++) {
@@ -1888,8 +1940,8 @@ var JsPdfDynamo = class {
1888
1940
  continue;
1889
1941
  }
1890
1942
  if (currLine.startsWith("[")) {
1891
- if (inGroupProcessing) {
1892
- inGroupProcessing = false;
1943
+ if (inGroupLoading) {
1944
+ inGroupLoading = false;
1893
1945
  __privateGet(this, _appLogger).debug(
1894
1946
  `Finished loading group ${grpName} (${currLine})
1895
1947
  `
@@ -1902,7 +1954,7 @@ var JsPdfDynamo = class {
1902
1954
  grpName = grpName.substring(0, iy);
1903
1955
  }
1904
1956
  grpName = grpName.trim().toLocaleUpperCase();
1905
- inGroupProcessing = true;
1957
+ inGroupLoading = true;
1906
1958
  __privateGet(this, _appLogger).debug(`Loading group ${grpName} (${currLine})
1907
1959
  `);
1908
1960
  currGroup = [];
@@ -1910,7 +1962,7 @@ var JsPdfDynamo = class {
1910
1962
  }
1911
1963
  continue;
1912
1964
  }
1913
- if (inGroupProcessing) {
1965
+ if (inGroupLoading) {
1914
1966
  currGroup.push(currLine);
1915
1967
  __privateGet(this, _appLogger).trace(` ${currLine}`);
1916
1968
  continue;
@@ -1934,12 +1986,6 @@ var JsPdfDynamo = class {
1934
1986
  case "AddBookmark".toLowerCase():
1935
1987
  processor.addBookmark(parameters);
1936
1988
  return;
1937
- case "AddImageFromFile".toLowerCase():
1938
- processor.addImageFromFile(parameters);
1939
- return;
1940
- case "AddImageFromUrl".toLowerCase():
1941
- yield processor.addImageFromUrl(parameters);
1942
- return;
1943
1989
  case "AddPage".toLowerCase():
1944
1990
  processor.addPage(parameters);
1945
1991
  return;
@@ -1949,6 +1995,9 @@ var JsPdfDynamo = class {
1949
1995
  case "CopyVar".toLowerCase():
1950
1996
  processor.copyVar(parameters);
1951
1997
  return;
1998
+ case "DivVar".toLowerCase():
1999
+ processor.divVar(parameters);
2000
+ return;
1952
2001
  case "Do".toLowerCase():
1953
2002
  yield this.processGroups(processor, parameters);
1954
2003
  return;
@@ -2009,6 +2058,12 @@ var JsPdfDynamo = class {
2009
2058
  case "IncVar".toLowerCase():
2010
2059
  processor.incVar(parameters);
2011
2060
  return;
2061
+ case "LoadImageFromFile".toLowerCase():
2062
+ processor.LoadImageFromFile(parameters);
2063
+ return;
2064
+ case "LoadImageFromUrl".toLowerCase():
2065
+ yield processor.LoadImageFromUrl(parameters);
2066
+ return;
2012
2067
  case "MultVar".toLowerCase():
2013
2068
  processor.multVar(parameters);
2014
2069
  return;
package/dist/index.d.cts CHANGED
@@ -307,8 +307,8 @@ declare class JsPdfProcessor {
307
307
  addBookmark(input: string): void;
308
308
  addPage(input?: string): void;
309
309
  private calcPageDimensions;
310
- addImageFromFile(input: string): void;
311
- addImageFromUrl(input: string): Promise<void>;
310
+ LoadImageFromFile(input: string): void;
311
+ LoadImageFromUrl(input: string): Promise<void>;
312
312
  private saveImage;
313
313
  private getContentType;
314
314
  checkPage(jsPdfDynamo: JsPdfDynamo, input: string): Promise<void>;
@@ -329,6 +329,7 @@ declare class JsPdfProcessor {
329
329
  incCurrentX(input: string): void;
330
330
  incCurrentY(input: string): void;
331
331
  incVar(input: string): void;
332
+ divVar(input: string): void;
332
333
  multVar(input: string): void;
333
334
  savePdf(input: string): void;
334
335
  selectPage(input: string): void;
@@ -365,7 +366,7 @@ declare class JsPdfDynamo {
365
366
  _processor: JsPdfProcessor;
366
367
  constructor(options?: Partial<IJsPdfOptions>, logger?: ILogger | null);
367
368
  toBlob(): Blob | null;
368
- toBlobUrl(fileName?: string): string | null;
369
+ toBlobUrl(): string | null;
369
370
  getVariable(variableName: string): string | null;
370
371
  private prepareNewPdf;
371
372
  prepareWrappedString(input: string): string;
package/dist/index.d.ts CHANGED
@@ -307,8 +307,8 @@ declare class JsPdfProcessor {
307
307
  addBookmark(input: string): void;
308
308
  addPage(input?: string): void;
309
309
  private calcPageDimensions;
310
- addImageFromFile(input: string): void;
311
- addImageFromUrl(input: string): Promise<void>;
310
+ LoadImageFromFile(input: string): void;
311
+ LoadImageFromUrl(input: string): Promise<void>;
312
312
  private saveImage;
313
313
  private getContentType;
314
314
  checkPage(jsPdfDynamo: JsPdfDynamo, input: string): Promise<void>;
@@ -329,6 +329,7 @@ declare class JsPdfProcessor {
329
329
  incCurrentX(input: string): void;
330
330
  incCurrentY(input: string): void;
331
331
  incVar(input: string): void;
332
+ divVar(input: string): void;
332
333
  multVar(input: string): void;
333
334
  savePdf(input: string): void;
334
335
  selectPage(input: string): void;
@@ -365,7 +366,7 @@ declare class JsPdfDynamo {
365
366
  _processor: JsPdfProcessor;
366
367
  constructor(options?: Partial<IJsPdfOptions>, logger?: ILogger | null);
367
368
  toBlob(): Blob | null;
368
- toBlobUrl(fileName?: string): string | null;
369
+ toBlobUrl(): string | null;
369
370
  getVariable(variableName: string): string | null;
370
371
  private prepareNewPdf;
371
372
  prepareWrappedString(input: string): string;
package/dist/index.js CHANGED
@@ -323,6 +323,11 @@ var JsPdfProcessor = class {
323
323
  })
324
324
  );
325
325
  this._variables.set("_DATEDMY", (/* @__PURE__ */ new Date()).toLocaleDateString("en-GB"));
326
+ this._variables.set("_IMAGEASPECT", "1");
327
+ this._variables.set("_IMAGEHEIGHT", "0");
328
+ this._variables.set("_IMAGEHEIGHTPX", "0");
329
+ this._variables.set("_IMAGEWIDTH", "0");
330
+ this._variables.set("_IMAGEWIDTHPX", "0");
326
331
  this._variables.set("_PAGENO", "1");
327
332
  this._variables.set("_PAGES", "1");
328
333
  this.posnX = 0;
@@ -687,8 +692,8 @@ var JsPdfProcessor = class {
687
692
  this.pageWidth = document.internal.pageSize.width - this._marginLeft - this._marginRight;
688
693
  }
689
694
  }
690
- addImageFromFile(input) {
691
- const subs = this.logAndParseCommand(".addImageFromFile", input);
695
+ LoadImageFromFile(input) {
696
+ const subs = this.logAndParseCommand(".LoadImageFromFile", input);
692
697
  let fileName = subs;
693
698
  if (!fileName) {
694
699
  this.lastError = "A file name is required.";
@@ -709,9 +714,9 @@ var JsPdfProcessor = class {
709
714
  this.lastResult = "0";
710
715
  }
711
716
  }
712
- addImageFromUrl(input) {
717
+ LoadImageFromUrl(input) {
713
718
  return __async(this, null, function* () {
714
- const subs = this.logAndParseCommand(".addImageFromUrl", input);
719
+ const subs = this.logAndParseCommand(".LoadImageFromUrl", input);
715
720
  let url = subs;
716
721
  if (!url) {
717
722
  this.lastError = "A URL is required.";
@@ -754,6 +759,10 @@ var JsPdfProcessor = class {
754
759
  this.setFixedDec(this.pixelsToUom(info.height), 3)
755
760
  );
756
761
  this._variables.set("_IMAGEHEIGHTPX", info.height.toString());
762
+ this._variables.set(
763
+ "_IMAGEASPECT",
764
+ info.height > 0 ? this.setFixedDec(info.width / info.height, 3) : "1"
765
+ );
757
766
  }
758
767
  getContentType(fileName) {
759
768
  const mediaType = fileName.split(".").pop();
@@ -1367,6 +1376,51 @@ var JsPdfProcessor = class {
1367
1376
  "Variable " + varName + " incremented to " + this._variables.get(varName)
1368
1377
  );
1369
1378
  }
1379
+ divVar(input) {
1380
+ let subs = this.substitute(input.trim());
1381
+ this._logger.debug(".divVar " + subs);
1382
+ let { first: varName, rest } = getNextString(subs.toLocaleUpperCase());
1383
+ if (varName === "") {
1384
+ this.lastResult = "0";
1385
+ this.lastError = "DivVar must reference a variable";
1386
+ return;
1387
+ }
1388
+ if (varName.startsWith("_")) {
1389
+ this.lastResult = "0";
1390
+ this.lastError = "DivVar can not be used to update system maintained variables";
1391
+ return;
1392
+ }
1393
+ let varValue = this._variables.get(varName);
1394
+ if (!varValue) {
1395
+ this.lastResult = "0";
1396
+ this.lastError = "Variable '" + varName + "' is not defined";
1397
+ return;
1398
+ }
1399
+ if (isNaN(Number(varValue))) {
1400
+ this._variables.set(varName, "0");
1401
+ }
1402
+ while (rest.length > 0) {
1403
+ const { first: nextOp, rest: remainder } = getNextNumber(rest, 4);
1404
+ rest = remainder;
1405
+ let varValue2 = this._variables.get(varName);
1406
+ if (!isNaN(Number(nextOp)) && Number(nextOp) === 0) {
1407
+ this.lastResult = "0";
1408
+ this.lastError = "Divide by zero error";
1409
+ return;
1410
+ }
1411
+ if (!isNaN(Number(varValue2)) && !isNaN(Number(nextOp))) {
1412
+ this._variables.set(
1413
+ varName,
1414
+ removeTrailingZeros((Number(varValue2) / Number(nextOp)).toFixed(4))
1415
+ );
1416
+ }
1417
+ varValue2 = this._variables.get(varName);
1418
+ }
1419
+ this.lastResult = "1";
1420
+ this._logger.trace(
1421
+ "Variable " + varName + " incremented to " + this._variables.get(varName)
1422
+ );
1423
+ }
1370
1424
  multVar(input) {
1371
1425
  let subs = this.substitute(input.trim());
1372
1426
  this._logger.debug(".multVar " + subs);
@@ -1815,11 +1869,9 @@ var JsPdfDynamo = class {
1815
1869
  return null;
1816
1870
  }
1817
1871
  }
1818
- toBlobUrl(fileName) {
1872
+ toBlobUrl() {
1819
1873
  try {
1820
- const result = this._processor.PdfDocument.output("bloburi", {
1821
- filename: fileName
1822
- });
1874
+ const result = this._processor.PdfDocument.output("bloburi");
1823
1875
  return result;
1824
1876
  } catch (e) {
1825
1877
  __privateGet(this, _appLogger).warn(
@@ -1850,7 +1902,7 @@ var JsPdfDynamo = class {
1850
1902
  }
1851
1903
  processTemplate(processor, input) {
1852
1904
  return __async(this, null, function* () {
1853
- let inGroupProcessing = false;
1905
+ let inGroupLoading = false;
1854
1906
  let grpName = "";
1855
1907
  let currGroup = [];
1856
1908
  for (let ix = 0; ix < input.length; ix++) {
@@ -1859,8 +1911,8 @@ var JsPdfDynamo = class {
1859
1911
  continue;
1860
1912
  }
1861
1913
  if (currLine.startsWith("[")) {
1862
- if (inGroupProcessing) {
1863
- inGroupProcessing = false;
1914
+ if (inGroupLoading) {
1915
+ inGroupLoading = false;
1864
1916
  __privateGet(this, _appLogger).debug(
1865
1917
  `Finished loading group ${grpName} (${currLine})
1866
1918
  `
@@ -1873,7 +1925,7 @@ var JsPdfDynamo = class {
1873
1925
  grpName = grpName.substring(0, iy);
1874
1926
  }
1875
1927
  grpName = grpName.trim().toLocaleUpperCase();
1876
- inGroupProcessing = true;
1928
+ inGroupLoading = true;
1877
1929
  __privateGet(this, _appLogger).debug(`Loading group ${grpName} (${currLine})
1878
1930
  `);
1879
1931
  currGroup = [];
@@ -1881,7 +1933,7 @@ var JsPdfDynamo = class {
1881
1933
  }
1882
1934
  continue;
1883
1935
  }
1884
- if (inGroupProcessing) {
1936
+ if (inGroupLoading) {
1885
1937
  currGroup.push(currLine);
1886
1938
  __privateGet(this, _appLogger).trace(` ${currLine}`);
1887
1939
  continue;
@@ -1905,12 +1957,6 @@ var JsPdfDynamo = class {
1905
1957
  case "AddBookmark".toLowerCase():
1906
1958
  processor.addBookmark(parameters);
1907
1959
  return;
1908
- case "AddImageFromFile".toLowerCase():
1909
- processor.addImageFromFile(parameters);
1910
- return;
1911
- case "AddImageFromUrl".toLowerCase():
1912
- yield processor.addImageFromUrl(parameters);
1913
- return;
1914
1960
  case "AddPage".toLowerCase():
1915
1961
  processor.addPage(parameters);
1916
1962
  return;
@@ -1920,6 +1966,9 @@ var JsPdfDynamo = class {
1920
1966
  case "CopyVar".toLowerCase():
1921
1967
  processor.copyVar(parameters);
1922
1968
  return;
1969
+ case "DivVar".toLowerCase():
1970
+ processor.divVar(parameters);
1971
+ return;
1923
1972
  case "Do".toLowerCase():
1924
1973
  yield this.processGroups(processor, parameters);
1925
1974
  return;
@@ -1980,6 +2029,12 @@ var JsPdfDynamo = class {
1980
2029
  case "IncVar".toLowerCase():
1981
2030
  processor.incVar(parameters);
1982
2031
  return;
2032
+ case "LoadImageFromFile".toLowerCase():
2033
+ processor.LoadImageFromFile(parameters);
2034
+ return;
2035
+ case "LoadImageFromUrl".toLowerCase():
2036
+ yield processor.LoadImageFromUrl(parameters);
2037
+ return;
1983
2038
  case "MultVar".toLowerCase():
1984
2039
  processor.multVar(parameters);
1985
2040
  return;
@@ -52,6 +52,11 @@
52
52
  .SetVar CommandLine2 The current font style. For example, "normal" or "italic".
53
53
  .Do VariableLine
54
54
 
55
+ .incCurrentY %halfLineGap%
56
+ .SetVar CommandLine1 _ImageAspect
57
+ .SetVar CommandLine2 The aspect ratio of the last loaded image, calculated as width divided by height.
58
+ .Do VariableLineWrapped
59
+
55
60
  .incCurrentY %halfLineGap%
56
61
  .SetVar CommandLine1 _ImageHeight
57
62
  .SetVar CommandLine2 The height of the last loaded image.
@@ -6,7 +6,7 @@
6
6
 
7
7
  .SetVar CommandSubHeading Syntax
8
8
  .Do CommandSubHeading
9
- .SetVar CommandLine1 .AddBookmark ParentId PageNo Text
9
+ .SetVar CommandLine1 .AddBookmark ParentId PageNo Text
10
10
  .Do CommandLine2
11
11
 
12
12
  .SetVar CommandSubHeading Parameters
@@ -4,15 +4,17 @@
4
4
 
5
5
  .SetVar CommandSubHeading Syntax
6
6
  .Do CommandSubHeading
7
- .SetVar CommandLine1 .AddPage {PageSize}
7
+ .SetVar CommandLine1 .AddPage PageSize Orientation
8
8
  .Do CommandLine2
9
9
 
10
10
  .SetVar CommandSubHeading Parameters
11
11
  .Do CommandSubHeading
12
12
  .SetVar CommandLine1 PageSize
13
- .SetVar CommandLine2 The page size: A3, A4, Letter, etc. Optional and if not supplied the
13
+ .SetVar CommandLine2 The size of the page to be added: A3, A4, Letter, etc. Optional and if not supplied, the current page size is used.
14
14
  .Do CommandLine2
15
- .SetVar CommandLine2 current page size is used
15
+ .SetVar CommandLine1 Orientation
16
+ .SetVar CommandLine2 The orientation of the page to be added: 'portrait' or 'landscape'. Optional and if not supplied, the
17
+ .SetVar CommandLine2 %CommandLine2% current orientation is used. The orientation can be abbreviated to the first letter, 'p' or 'l'.
16
18
  .Do CommandLine2
17
19
 
18
20
  .SetVar CommandSubHeading Other
@@ -12,7 +12,7 @@
12
12
 
13
13
  .SetVar CommandSubHeading Syntax
14
14
  .Do CommandSubHeading
15
- .SetVar CommandLine1 .CheckPage Distance {Group1, Group2 ...}
15
+ .SetVar CommandLine1 .CheckPage Distance {Group1, Group2 ...}
16
16
  .Do CommandLine2
17
17
 
18
18
  .SetVar CommandSubHeading Parameters
@@ -6,7 +6,7 @@
6
6
 
7
7
  .SetVar CommandSubHeading Syntax
8
8
  .Do CommandSubHeading
9
- .SetVar CommandLine1 .CopyVar CopyTo CopyFrom
9
+ .SetVar CommandLine1 .CopyVar CopyTo CopyFrom
10
10
  .Do CommandLine2
11
11
 
12
12
  .SetVar CommandSubHeading Parameters
@@ -47,6 +47,6 @@
47
47
 
48
48
  .SetVar CommandSubHeading See Also
49
49
  .Do CommandSubHeading
50
- .SetVar CommandLine1 IncVar, MultVar, SetVar
50
+ .SetVar CommandLine1 DivVar, IncVar, MultVar, SetVar
51
51
  .Do CommandLine2
52
52
  .incCurrentY %_FontHeight%
@@ -0,0 +1,67 @@
1
+ .SetVar CommandName DivVar
2
+ .Do CommandHeading
3
+ .DrawText 0 %_CurrentY% Divide the value of a variable by one or more factors.
4
+
5
+ .SetVar CommandSubHeading Syntax
6
+ .Do CommandSubHeading
7
+ .SetVar CommandLine1 .DivVar Variable Value Value (etc)
8
+ .Do CommandLine2
9
+
10
+ .SetVar CommandSubHeading Parameters
11
+ .Do CommandSubHeading
12
+ .SetVar CommandLine1 Variable
13
+ .SetVar CommandLine2 The name of the variable to update. This is not usually a substitution variable,
14
+ .SetVar CommandLine2 %CommandLine2% but it can be, or contain substitution variables. The variable must exist.
15
+ .Do CommandLine2
16
+ .SetVar CommandLine1 Value
17
+ .SetVar CommandLine2 One or more values to multiple the variable by. These can be constants or substitution variables.
18
+ .Do CommandLine2
19
+
20
+ .SetVar CommandSubHeading Other
21
+ .Do CommandSubHeading
22
+ .SetVar CommandLine1 Variable _LastResult is set to '1' if a valid variable name is provided, otherwise it is set to '0'.
23
+ .Do CommandLine
24
+ .SetVar CommandLine1 The JsPdfDynamo maintained variables (those whose name starts with an underscore) can not
25
+ .Do CommandLine
26
+ .SetVar CommandLine1 be changed by this command.
27
+ .Do CommandLine
28
+ .incCurrentY %halfLineGap%
29
+ .SetVar CommandLine1 The variable name may itself be, or contain a variable.
30
+ .Do CommandLine
31
+
32
+ .SetVar CommandSubHeading Examples
33
+ .Do CommandSubHeading
34
+ .SetVar CommandLine1 Divide the value of the variable 'Total' by '4':
35
+ .Do CommandLine
36
+ .incCurrentY %halfLineGap%
37
+ .SetVar CommandLine1 .SetVar Total 12
38
+ .Do CommandLine2
39
+ .SetVar CommandLine1 .DivVar Total 4
40
+ .Do CommandLine2
41
+ .incCurrentY %_FontHeight%
42
+
43
+ .SetVar CommandLine1 Decrease the value of 'Weight6' by half from '78.6' to '39.3':
44
+ .Do CommandLine
45
+ .incCurrentY %halfLineGap%
46
+ .SetVar CommandLine1 .SetVar index 6
47
+ .Do CommandLine2
48
+ .SetVar CommandLine1 .SetVar Weight%%%%index%%%% 78.6
49
+ .Do CommandLine2
50
+ .SetVar CommandLine1 .DivVar Weight%%%%index%%%% 2
51
+ .Do CommandLine2
52
+ .incCurrentY %_FontHeight%
53
+
54
+ .SetVar CommandLine1 Multiple values can be used to increase value of 'total' from 100 to 5
55
+ .Do CommandLine
56
+ .incCurrentY %halfLineGap%
57
+ .SetVar CommandLine1 .SetVar Total 10
58
+ .Do CommandLine2
59
+ .SetVar CommandLine1 .DivVar Total 10 2
60
+ .Do CommandLine2
61
+ .incCurrentY %_FontHeight%
62
+
63
+ .SetVar CommandSubHeading See Also
64
+ .Do CommandSubHeading
65
+ .SetVar CommandLine1 CopyVar, IncVar, MultVar, SetVar
66
+ .Do CommandLine2
67
+ .incCurrentY %_FontHeight%
@@ -3,7 +3,7 @@
3
3
  .DrawText 0 %_CurrentY% 'Do' (ie process) one or more groups of commands that have already been defined.
4
4
  .SetVar CommandSubHeading Syntax
5
5
  .Do CommandSubHeading
6
- .SetVar CommandLine1 .Do Group1, Group2...etc
6
+ .SetVar CommandLine1 .Do Group1, Group2...etc
7
7
  .Do CommandLine2
8
8
 
9
9
  .SetVar CommandSubHeading Parameters
@@ -6,7 +6,7 @@
6
6
 
7
7
  .SetVar CommandSubHeading Syntax
8
8
  .Do CommandSubHeading
9
- .SetVar CommandLine1 .DoRepeat Number Group1, Group2...etc
9
+ .SetVar CommandLine1 .DoRepeat Number Group1, Group2...etc
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 .DrawBox Left Top Width Height Option
7
+ .SetVar CommandLine1 .DrawBox Left Top Width Height Option
8
8
  .Do CommandLine2
9
9
 
10
10
  .SetVar CommandSubHeading Parameters
@@ -7,7 +7,7 @@
7
7
 
8
8
  .SetVar CommandSubHeading Syntax
9
9
  .Do CommandSubHeading
10
- .SetVar CommandLine1 .DrawDebugGrid Option
10
+ .SetVar CommandLine1 .DrawDebugGrid Option
11
11
  .Do CommandLine2
12
12
 
13
13
  .SetVar CommandSubHeading Parameters
@@ -5,7 +5,7 @@
5
5
 
6
6
  .SetVar CommandSubHeading Syntax
7
7
  .Do CommandSubHeading
8
- .SetVar CommandLine1 .DrawImage ImageNo Left Top Width Height Scale
8
+ .SetVar CommandLine1 .DrawImage ImageNo Left Top Width Height Scale
9
9
  .Do CommandLine2
10
10
 
11
11
  .SetVar CommandSubHeading Parameters
@@ -87,6 +87,6 @@
87
87
 
88
88
  .SetVar CommandSubHeading See Also
89
89
  .Do CommandSubHeading
90
- .SetVar CommandLine1 AddImageFromFile, AddImageFromUrl
90
+ .SetVar CommandLine1 LoadImageFromFile, LoadImageFromUrl
91
91
  .Do CommandLine2
92
92
  .incCurrentY %_FontHeight%
@@ -7,7 +7,7 @@
7
7
 
8
8
  .SetVar CommandSubHeading Syntax
9
9
  .Do CommandSubHeading
10
- .SetVar CommandLine1 .DrawLine Left Top Right Bottom
10
+ .SetVar CommandLine1 .DrawLine Left Top Right Bottom
11
11
  .Do CommandLine2
12
12
 
13
13
  .SetVar CommandSubHeading Parameters
@@ -12,7 +12,7 @@
12
12
 
13
13
  .SetVar CommandSubHeading Syntax
14
14
  .Do CommandSubHeading
15
- .SetVar CommandLine1 .ForEachPage Group1, Group2...etc
15
+ .SetVar CommandLine1 .ForEachPage Group1, Group2...etc
16
16
  .Do CommandLine2
17
17
 
18
18
  .SetVar CommandSubHeading Parameters