@pdfme/schemas 4.0.0-alpha.0 → 4.0.0
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/README.md +1 -0
- package/dist/cjs/__tests__/text.test.js +10 -4
- package/dist/cjs/__tests__/text.test.js.map +1 -1
- package/dist/cjs/src/barcodes/propPanel.js +12 -0
- package/dist/cjs/src/barcodes/propPanel.js.map +1 -1
- package/dist/cjs/src/graphics/cacheKey.js +6 -0
- package/dist/cjs/src/graphics/cacheKey.js.map +1 -0
- package/dist/cjs/src/graphics/image.js +26 -15
- package/dist/cjs/src/graphics/image.js.map +1 -1
- package/dist/{esm/src/graphics/helper.js → cjs/src/graphics/imagehelper.js} +15 -2
- package/dist/cjs/src/graphics/imagehelper.js.map +1 -0
- package/dist/cjs/src/graphics/pdfHelper.js +49 -0
- package/dist/cjs/src/graphics/pdfHelper.js.map +1 -0
- package/dist/cjs/src/graphics/svg.js +2 -0
- package/dist/cjs/src/graphics/svg.js.map +1 -1
- package/dist/cjs/src/index.js +3 -2
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/shapes/line.js +4 -2
- package/dist/cjs/src/shapes/line.js.map +1 -1
- package/dist/cjs/src/shapes/rectAndEllipse.js +13 -6
- package/dist/cjs/src/shapes/rectAndEllipse.js.map +1 -1
- package/dist/cjs/src/tables/pdfRender.js +0 -2
- package/dist/cjs/src/tables/pdfRender.js.map +1 -1
- package/dist/cjs/src/tables/propPanel.js +1 -0
- package/dist/cjs/src/tables/propPanel.js.map +1 -1
- package/dist/cjs/src/tables/uiRender.js +44 -23
- package/dist/cjs/src/tables/uiRender.js.map +1 -1
- package/dist/cjs/src/text/helper.js +27 -7
- package/dist/cjs/src/text/helper.js.map +1 -1
- package/dist/cjs/src/text/index.js +1 -0
- package/dist/cjs/src/text/index.js.map +1 -1
- package/dist/cjs/src/text/pdfRender.js +4 -4
- package/dist/cjs/src/text/pdfRender.js.map +1 -1
- package/dist/cjs/src/text/propPanel.js +1 -0
- package/dist/cjs/src/text/propPanel.js.map +1 -1
- package/dist/cjs/src/text/uiRender.js +22 -1
- package/dist/cjs/src/text/uiRender.js.map +1 -1
- package/dist/cjs/src/utils.js +37 -7
- package/dist/cjs/src/utils.js.map +1 -1
- package/dist/esm/__tests__/text.test.js +10 -4
- package/dist/esm/__tests__/text.test.js.map +1 -1
- package/dist/esm/src/barcodes/propPanel.js +12 -0
- package/dist/esm/src/barcodes/propPanel.js.map +1 -1
- package/dist/esm/src/graphics/cacheKey.js +2 -0
- package/dist/esm/src/graphics/cacheKey.js.map +1 -0
- package/dist/esm/src/graphics/image.js +25 -14
- package/dist/esm/src/graphics/image.js.map +1 -1
- package/dist/{cjs/src/graphics/helper.js → esm/src/graphics/imagehelper.js} +10 -5
- package/dist/esm/src/graphics/imagehelper.js.map +1 -0
- package/dist/esm/src/graphics/pdfHelper.js +44 -0
- package/dist/esm/src/graphics/pdfHelper.js.map +1 -0
- package/dist/esm/src/graphics/svg.js +2 -0
- package/dist/esm/src/graphics/svg.js.map +1 -1
- package/dist/esm/src/index.js +2 -1
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/shapes/line.js +5 -3
- package/dist/esm/src/shapes/line.js.map +1 -1
- package/dist/esm/src/shapes/rectAndEllipse.js +14 -7
- package/dist/esm/src/shapes/rectAndEllipse.js.map +1 -1
- package/dist/esm/src/tables/pdfRender.js +0 -2
- package/dist/esm/src/tables/pdfRender.js.map +1 -1
- package/dist/esm/src/tables/propPanel.js +1 -0
- package/dist/esm/src/tables/propPanel.js.map +1 -1
- package/dist/esm/src/tables/uiRender.js +39 -18
- package/dist/esm/src/tables/uiRender.js.map +1 -1
- package/dist/esm/src/text/helper.js +25 -6
- package/dist/esm/src/text/helper.js.map +1 -1
- package/dist/esm/src/text/index.js +1 -0
- package/dist/esm/src/text/index.js.map +1 -1
- package/dist/esm/src/text/pdfRender.js +6 -6
- package/dist/esm/src/text/pdfRender.js.map +1 -1
- package/dist/esm/src/text/propPanel.js +1 -0
- package/dist/esm/src/text/propPanel.js.map +1 -1
- package/dist/esm/src/text/uiRender.js +23 -2
- package/dist/esm/src/text/uiRender.js.map +1 -1
- package/dist/esm/src/utils.js +35 -6
- package/dist/esm/src/utils.js.map +1 -1
- package/dist/types/src/graphics/cacheKey.d.ts +2 -0
- package/dist/types/src/graphics/image.d.ts +1 -1
- package/dist/types/src/graphics/imagehelper.d.ts +4 -0
- package/dist/types/src/graphics/pdfHelper.d.ts +8 -0
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/shapes/rectAndEllipse.d.ts +6 -0
- package/dist/types/src/text/helper.d.ts +1 -0
- package/dist/types/src/utils.d.ts +3 -2
- package/package.json +1 -1
- package/src/barcodes/propPanel.ts +14 -0
- package/src/graphics/cacheKey.ts +3 -0
- package/src/graphics/image.ts +28 -19
- package/src/graphics/{helper.ts → imagehelper.ts} +10 -1
- package/src/graphics/pdfHelper.ts +55 -0
- package/src/graphics/svg.ts +2 -0
- package/src/index.ts +3 -1
- package/src/shapes/line.ts +5 -3
- package/src/shapes/rectAndEllipse.ts +17 -7
- package/src/tables/pdfRender.ts +0 -2
- package/src/tables/propPanel.ts +1 -0
- package/src/tables/uiRender.ts +50 -19
- package/src/text/helper.ts +27 -6
- package/src/text/index.ts +1 -0
- package/src/text/pdfRender.ts +14 -5
- package/src/text/propPanel.ts +1 -0
- package/src/text/uiRender.ts +22 -1
- package/src/utils.ts +46 -9
- package/dist/cjs/src/graphics/helper.js.map +0 -1
- package/dist/esm/src/graphics/helper.js.map +0 -1
- package/dist/types/src/graphics/helper.d.ts +0 -5
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"uiRender.js","sourceRoot":"","sources":["../../../../src/text/uiRender.ts"],"names":[],"mappings":";;;AACA,0CAAsE;AAEtE,iDAWwB;AACxB,
|
1
|
+
{"version":3,"file":"uiRender.js","sourceRoot":"","sources":["../../../../src/text/uiRender.ts"],"names":[],"mappings":";;;AACA,0CAAsE;A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MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;gBACxC,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;gBACrC,KAAK,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;gBACpC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,4BAA4B;gBACnD,SAAS,EAAE,eAAe,EAAE,CAAC;gBAC7B,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;SACJ;KACF;SAAM;QACL,SAAS,CAAC,SAAS,GAAG,KAAK;aACxB,KAAK,CAAC,EAAE,CAAC;aACT,GAAG,CACF,CAAC,CAAS,EAAE,CAAS,EAAE,EAAE,CACvB,+BACE,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SACvC,MAAM,CAAC,SAAS,CACnB;aACA,IAAI,CAAC,EAAE,CAAC,CAAC;QAEZ,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;KAClC;AACH,CAAC,CAAC;AA5KW,QAAA,QAAQ,YA4KnB"}
|
package/dist/cjs/src/utils.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.cloneDeep = exports.
|
3
|
+
exports.cloneDeep = exports.createErrorElm = exports.readFile = exports.hex2PrintingColor = exports.hex2CmykColor = exports.hex2RgbColor = exports.isEditable = exports.addAlphaToHex = exports.rotatePoint = exports.convertForPdfLayoutProps = void 0;
|
4
4
|
const pdf_lib_1 = require("@pdfme/pdf-lib");
|
5
5
|
const common_1 = require("@pdfme/common");
|
6
6
|
const convertForPdfLayoutProps = ({ schema, pageHeight, applyRotateTranslate = true, }) => {
|
@@ -80,6 +80,42 @@ const hex2RgbColor = (hexString) => {
|
|
80
80
|
return undefined;
|
81
81
|
};
|
82
82
|
exports.hex2RgbColor = hex2RgbColor;
|
83
|
+
const hex2CmykColor = (hexString) => {
|
84
|
+
if (hexString) {
|
85
|
+
const isValid = (0, common_1.isHexValid)(hexString);
|
86
|
+
if (!isValid) {
|
87
|
+
throw new Error(`Invalid hex color value ${hexString}`);
|
88
|
+
}
|
89
|
+
// Remove the # if it's present
|
90
|
+
hexString = hexString.replace('#', '');
|
91
|
+
// Extract the hexadecimal color code and the opacity
|
92
|
+
const hexColor = hexString.substring(0, 6);
|
93
|
+
const opacityColor = hexString.substring(6, 8);
|
94
|
+
const opacity = opacityColor ? parseInt(opacityColor, 16) / 255 : 1;
|
95
|
+
// Convert the hex values to decimal
|
96
|
+
let r = parseInt(hexColor.substring(0, 2), 16) / 255;
|
97
|
+
let g = parseInt(hexColor.substring(2, 4), 16) / 255;
|
98
|
+
let b = parseInt(hexColor.substring(4, 6), 16) / 255;
|
99
|
+
// Apply the opacity
|
100
|
+
r = r * opacity + (1 - opacity);
|
101
|
+
g = g * opacity + (1 - opacity);
|
102
|
+
b = b * opacity + (1 - opacity);
|
103
|
+
// Calculate the CMYK values
|
104
|
+
const k = 1 - Math.max(r, g, b);
|
105
|
+
const c = r === 0 ? 0 : (1 - r - k) / (1 - k);
|
106
|
+
const m = g === 0 ? 0 : (1 - g - k) / (1 - k);
|
107
|
+
const y = b === 0 ? 0 : (1 - b - k) / (1 - k);
|
108
|
+
return (0, pdf_lib_1.cmyk)(c, m, y, k);
|
109
|
+
}
|
110
|
+
return undefined;
|
111
|
+
};
|
112
|
+
exports.hex2CmykColor = hex2CmykColor;
|
113
|
+
const hex2PrintingColor = (hexString, colorType) => {
|
114
|
+
return colorType?.toLocaleLowerCase() == 'cmyk'
|
115
|
+
? (0, exports.hex2CmykColor)(hexString)
|
116
|
+
: (0, exports.hex2RgbColor)(hexString);
|
117
|
+
};
|
118
|
+
exports.hex2PrintingColor = hex2PrintingColor;
|
83
119
|
const readFile = (input) => new Promise((resolve, reject) => {
|
84
120
|
const fileReader = new FileReader();
|
85
121
|
fileReader.onload = (e) => {
|
@@ -131,12 +167,6 @@ const createErrorElm = () => {
|
|
131
167
|
return container;
|
132
168
|
};
|
133
169
|
exports.createErrorElm = createErrorElm;
|
134
|
-
const px2mm = (px) => {
|
135
|
-
// http://www.endmemo.com/sconvert/millimeterpixel.php
|
136
|
-
const ratio = 0.26458333333333;
|
137
|
-
return parseFloat(String(px)) * ratio;
|
138
|
-
};
|
139
|
-
exports.px2mm = px2mm;
|
140
170
|
const cloneDeep = (value) => JSON.parse(JSON.stringify(value));
|
141
171
|
exports.cloneDeep = cloneDeep;
|
142
172
|
//# sourceMappingURL=utils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":";;;AACA,
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":";;;AACA,4CAAsE;AACtE,0CAA2E;AAEpE,MAAM,wBAAwB,GAAG,CAAC,EACvC,MAAM,EACN,UAAU,EACV,oBAAoB,GAAG,IAAI,GAK5B,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IAC/E,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAC;IAEpC,MAAM,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAC;IAC/B,IAAI,CAAC,GAAG,IAAA,cAAK,EAAC,GAAG,CAAC,CAAC;IACnB,2FAA2F;IAC3F,IAAI,C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KAAK;QACnB,UAAU,EAAE,yBAAyB;KACtC,CAAC;IACF,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAErC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;IAC3B,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAE5B,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AA3BW,QAAA,cAAc,kBA2BzB;AACK,MAAM,SAAS,GAAG,CAAI,KAAQ,EAAK,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AAAlE,QAAA,SAAS,aAAyD"}
|
@@ -56,19 +56,25 @@ describe('getSplitPosition test with mocked font width calculations', () => {
|
|
56
56
|
expect(getSplittedLines('a', mockCalcValues)).toEqual(['a']);
|
57
57
|
expect(getSplittedLines('aaaa', mockCalcValues)).toEqual(['aaaa']);
|
58
58
|
});
|
59
|
-
it('splits a line to the nearest previous
|
59
|
+
it('splits a line to the nearest previous breakable char', () => {
|
60
60
|
expect(getSplittedLines('aaa bbb', mockCalcValues)).toEqual(['aaa', 'bbb']);
|
61
|
+
expect(getSplittedLines('top-hat', mockCalcValues)).toEqual(['top-', 'hat']);
|
62
|
+
expect(getSplittedLines('top—hat', mockCalcValues)).toEqual(['top—', 'hat']); // em dash
|
63
|
+
expect(getSplittedLines('top–hat', mockCalcValues)).toEqual(['top–', 'hat']); // en dash
|
61
64
|
});
|
62
|
-
it('splits a line where the split point is on a
|
65
|
+
it('splits a line where the split point is on a breakable char', () => {
|
63
66
|
expect(getSplittedLines('aaaaa bbbbb', mockCalcValues)).toEqual(['aaaaa', 'bbbbb']);
|
67
|
+
expect(getSplittedLines('left-hand', mockCalcValues)).toEqual(['left-', 'hand']);
|
64
68
|
});
|
65
69
|
it('splits a long line in the middle of a word if too long', () => {
|
66
70
|
expect(getSplittedLines('aaaaaa bbb', mockCalcValues)).toEqual(['aaaaa', 'a bbb']);
|
71
|
+
expect(getSplittedLines('aaaaaa-a b', mockCalcValues)).toEqual(['aaaaa', 'a-a b']);
|
72
|
+
expect(getSplittedLines('aaaaa-aa b', mockCalcValues)).toEqual(['aaaaa', '-aa b']);
|
67
73
|
});
|
68
|
-
it('splits a long line without
|
74
|
+
it('splits a long line without breakable chars at exactly 5 chars', () => {
|
69
75
|
expect(getSplittedLines('abcdef', mockCalcValues)).toEqual(['abcde', 'f']);
|
70
76
|
});
|
71
|
-
it('splits a very long line without
|
77
|
+
it('splits a very long line without breakable chars at exactly 5 chars', () => {
|
72
78
|
expect(getSplittedLines('abcdefghijklmn', mockCalcValues)).toEqual(['abcde', 'fghij', 'klmn']);
|
73
79
|
});
|
74
80
|
it('splits a line with lots of words', () => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"text.test.js","sourceRoot":"","sources":["../../../__tests__/text.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAQ,cAAc,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EACjC,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kCAAkC,CAAC,CAAC,CAAC;AACxF,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mCAAmC,CAAC,CAAC,CAAC;AAE1F,MAAM,aAAa,GAAG,GAAS,EAAE,CAAC,CAAC;IACjC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;IAClD,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;CACrC,CAAC,CAAC;AAEH,MAAM,aAAa,GAA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I,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;YAC1E,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,CAAC;SACb,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iFAAiF,EAAE,GAAG,EAAE;QAC3F,MAAM,QAAQ,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAiB,CAAC;QAChF,MAAM,CAAC,iCAAiC,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;YAC7E,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,CAAC;SACb,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
@@ -8,10 +8,12 @@ const defaultTextColors = { textColor: DEFAULT_BARCODE_COLOR };
|
|
8
8
|
const defaultIncludetext = { includetext: DEFAULT_BARCODE_INCLUDETEXT };
|
9
9
|
const position = { x: 0, y: 0 };
|
10
10
|
const default40x20 = { width: 40, height: 20 };
|
11
|
+
const barcodeIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-barcode"><path d="M3 5v14"/><path d="M8 5v14"/><path d="M12 5v14"/><path d="M17 5v14"/><path d="M21 5v14"/></svg>';
|
11
12
|
const barcodeDefaults = [
|
12
13
|
{
|
13
14
|
defaultSchema: {
|
14
15
|
type: 'qrcode',
|
16
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-qr-code"><rect width="5" height="5" x="3" y="3" rx="1"/><rect width="5" height="5" x="16" y="3" rx="1"/><rect width="5" height="5" x="3" y="16" rx="1"/><path d="M21 16h-3a2 2 0 0 0-2 2v3"/><path d="M21 21v.01"/><path d="M12 7v3a2 2 0 0 1-2 2H7"/><path d="M3 12h.01"/><path d="M12 3h.01"/><path d="M12 16v.01"/><path d="M16 12h1"/><path d="M21 12v.01"/><path d="M12 21v-1"/></svg>',
|
15
17
|
content: 'https://pdfme.com/',
|
16
18
|
position,
|
17
19
|
...defaultColors,
|
@@ -24,6 +26,7 @@ const barcodeDefaults = [
|
|
24
26
|
{
|
25
27
|
defaultSchema: {
|
26
28
|
type: 'japanpost',
|
29
|
+
icon: barcodeIcon,
|
27
30
|
content: '6540123789-A-K-Z',
|
28
31
|
position,
|
29
32
|
...defaultColors,
|
@@ -38,6 +41,7 @@ const barcodeDefaults = [
|
|
38
41
|
{
|
39
42
|
defaultSchema: {
|
40
43
|
type: 'ean13',
|
44
|
+
icon: barcodeIcon,
|
41
45
|
content: '2112345678900',
|
42
46
|
position,
|
43
47
|
...defaultColors,
|
@@ -52,6 +56,7 @@ const barcodeDefaults = [
|
|
52
56
|
{
|
53
57
|
defaultSchema: {
|
54
58
|
type: 'ean8',
|
59
|
+
icon: barcodeIcon,
|
55
60
|
content: '02345673',
|
56
61
|
position,
|
57
62
|
...defaultColors,
|
@@ -65,6 +70,7 @@ const barcodeDefaults = [
|
|
65
70
|
{
|
66
71
|
defaultSchema: {
|
67
72
|
type: 'code39',
|
73
|
+
icon: barcodeIcon,
|
68
74
|
content: 'THIS IS CODE 39',
|
69
75
|
position,
|
70
76
|
...defaultColors,
|
@@ -77,6 +83,7 @@ const barcodeDefaults = [
|
|
77
83
|
{
|
78
84
|
defaultSchema: {
|
79
85
|
type: 'code128',
|
86
|
+
icon: barcodeIcon,
|
80
87
|
content: 'This is Code 128!',
|
81
88
|
position,
|
82
89
|
...defaultColors,
|
@@ -90,6 +97,7 @@ const barcodeDefaults = [
|
|
90
97
|
{
|
91
98
|
defaultSchema: {
|
92
99
|
type: 'nw7',
|
100
|
+
icon: barcodeIcon,
|
93
101
|
content: 'A0123456789B',
|
94
102
|
position,
|
95
103
|
...defaultColors,
|
@@ -103,6 +111,7 @@ const barcodeDefaults = [
|
|
103
111
|
{
|
104
112
|
defaultSchema: {
|
105
113
|
type: 'itf14',
|
114
|
+
icon: barcodeIcon,
|
106
115
|
content: '04601234567893',
|
107
116
|
position,
|
108
117
|
...defaultColors,
|
@@ -117,6 +126,7 @@ const barcodeDefaults = [
|
|
117
126
|
{
|
118
127
|
defaultSchema: {
|
119
128
|
type: 'upca',
|
129
|
+
icon: barcodeIcon,
|
120
130
|
content: '416000336108',
|
121
131
|
position,
|
122
132
|
...defaultColors,
|
@@ -131,6 +141,7 @@ const barcodeDefaults = [
|
|
131
141
|
{
|
132
142
|
defaultSchema: {
|
133
143
|
type: 'upce',
|
144
|
+
icon: barcodeIcon,
|
134
145
|
content: '00123457',
|
135
146
|
position,
|
136
147
|
...defaultColors,
|
@@ -144,6 +155,7 @@ const barcodeDefaults = [
|
|
144
155
|
{
|
145
156
|
defaultSchema: {
|
146
157
|
type: 'gs1datamatrix',
|
158
|
+
icon: barcodeIcon,
|
147
159
|
content: '(01)03453120000011(17)191125(10)ABCD1234',
|
148
160
|
position,
|
149
161
|
...defaultColors,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"propPanel.js","sourceRoot":"","sources":["../../../../src/barcodes/propPanel.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAErE,MAAM,aAAa,GAAG;IACpB,eAAe,EAAE,wBAAwB;IACzC,QAAQ,EAAE,qBAAqB;CAChC,CAAC;AACF,MAAM,iBAAiB,GAAG,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;AAC/D,MAAM,kBAAkB,GAAG,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;AACxE,MAAM,QAAQ,GAAG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src/graphics/cacheKey.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,KAAa,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,EAAE,CAAC"}
|
@@ -1,27 +1,32 @@
|
|
1
|
-
import {
|
2
|
-
import { convertForPdfLayoutProps, addAlphaToHex, isEditable, readFile
|
1
|
+
import { px2mm } from '@pdfme/common';
|
2
|
+
import { convertForPdfLayoutProps, addAlphaToHex, isEditable, readFile } from '../utils.js';
|
3
3
|
import { DEFAULT_OPACITY } from '../constants.js';
|
4
|
-
import {
|
4
|
+
import { getImageDimension } from './imagehelper.js';
|
5
|
+
import { isPdf, pdfToImage } from './pdfHelper.js';
|
5
6
|
const getCacheKey = (schema, input) => `${schema.type}${input}`;
|
6
7
|
const fullSize = { width: '100%', height: '100%' };
|
7
8
|
const defaultValue = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUgAAAGQBAMAAAA+V+RCAAAAAXNSR0IArs4c6QAAABtQTFRFAAAAR3BMAAAAAAAAAAAAAAAAAAAAAAAAAAAAqmQqwQAAAAh0Uk5TDQAvVYGtxusE1uR9AAAKg0lEQVR42tTbwU7bQBDG8TWoPeOBPoBbdbhiVMGV0Kr0GChSe0RtRfccEOROnP0eu8ckTMHrjD27/h4Afvo7u4kUxZXbjuboZ+Hx9vrz+6J8eW5rJKPHhYfr46J/JHn0u/DnuHcko/eF71Ub0j6k3P1Rr0jGIHs4bkPah5RbnveHZMBQ6VKHlMqjnpCMAdfUApk8pNx91QeSMex+C2R2IYFwrkcyht6yEsjkIeXutEjG8AtnApldSGBRqJAMk10JZHYhgaZSIBlG+yWQipAGKZ0ipNmr0uUaEmiKLZEMw52tkLqQD7f6PT7iv1uskLqQV06/nQ9ffswhF+oVUhMS07KX7Xz6+8ot5BQhBVLF/Pry0XGKkAKpGp3IRz7pjmQMiSz3TvB8s85I8h2ReuWy6IpkDIws6UI8745I8oMjy10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11
|
const { value, schema, pdfDoc, page, _cache } = arg;
|
11
|
-
|
12
|
+
const isGraphicPdf = isPdf(value);
|
13
|
+
const isImageOrPdf = value.startsWith('data:image/') || isGraphicPdf;
|
14
|
+
if (!value || !isImageOrPdf)
|
12
15
|
return;
|
13
16
|
const inputImageCacheKey = getCacheKey(schema, value);
|
14
17
|
let image = _cache.get(inputImageCacheKey);
|
15
18
|
if (!image) {
|
16
|
-
|
17
|
-
|
19
|
+
if (isGraphicPdf) {
|
20
|
+
[image] = await pdfDoc.embedPdf(value);
|
21
|
+
}
|
22
|
+
else {
|
23
|
+
const isPng = value.startsWith('data:image/png;');
|
24
|
+
image = await (isPng ? pdfDoc.embedPng(value) : pdfDoc.embedJpg(value));
|
25
|
+
}
|
18
26
|
_cache.set(inputImageCacheKey, image);
|
19
27
|
}
|
20
28
|
const _schema = { ...schema, position: { ...schema.position } };
|
21
|
-
const
|
22
|
-
const idx = value.indexOf(dataUriPrefix);
|
23
|
-
const imgBase64 = value.substring(idx + dataUriPrefix.length, value.length);
|
24
|
-
const dimension = imageSize(Buffer.from(imgBase64, 'base64'));
|
29
|
+
const dimension = isGraphicPdf ? image.scale(1) : getImageDimension(value);
|
25
30
|
const imageWidth = px2mm(dimension.width);
|
26
31
|
const imageHeight = px2mm(dimension.height);
|
27
32
|
const boxWidth = _schema.width;
|
@@ -42,9 +47,12 @@ const imageSchema = {
|
|
42
47
|
const lProps = convertForPdfLayoutProps({ schema: _schema, pageHeight });
|
43
48
|
const { width, height, rotate, position, opacity } = lProps;
|
44
49
|
const { x, y } = position;
|
45
|
-
|
50
|
+
const drawOptions = { x, y, rotate, width, height, opacity };
|
51
|
+
isGraphicPdf
|
52
|
+
? page.drawPage(image, drawOptions)
|
53
|
+
: page.drawImage(image, drawOptions);
|
46
54
|
},
|
47
|
-
ui: (arg) => {
|
55
|
+
ui: async (arg) => {
|
48
56
|
const { value, rootElement, mode, onChange, stopEditing, tabIndex, placeholder, theme, schema, } = arg;
|
49
57
|
const editable = isEditable(mode, schema);
|
50
58
|
const isDefault = value === defaultValue;
|
@@ -66,6 +74,7 @@ const imageSchema = {
|
|
66
74
|
rootElement.appendChild(container);
|
67
75
|
// image tag
|
68
76
|
if (value) {
|
77
|
+
let src = isPdf(value) ? await pdfToImage(arg) : value;
|
69
78
|
const img = document.createElement('img');
|
70
79
|
const imgStyle = {
|
71
80
|
height: '100%',
|
@@ -74,7 +83,7 @@ const imageSchema = {
|
|
74
83
|
objectFit: 'contain',
|
75
84
|
};
|
76
85
|
Object.assign(img.style, imgStyle);
|
77
|
-
img.src =
|
86
|
+
img.src = src;
|
78
87
|
container.appendChild(img);
|
79
88
|
}
|
80
89
|
// remove button
|
@@ -130,7 +139,7 @@ const imageSchema = {
|
|
130
139
|
Object.assign(input.style, inputStyle);
|
131
140
|
input.tabIndex = tabIndex || 0;
|
132
141
|
input.type = 'file';
|
133
|
-
input.accept = 'image/jpeg, image/png';
|
142
|
+
input.accept = 'image/jpeg, image/png, application/pdf';
|
134
143
|
input.addEventListener('change', (event) => {
|
135
144
|
const changeEvent = event;
|
136
145
|
readFile(changeEvent.target.files).then((result) => onChange && onChange({ key: 'content', value: result }));
|
@@ -143,6 +152,7 @@ const imageSchema = {
|
|
143
152
|
schema: {},
|
144
153
|
defaultSchema: {
|
145
154
|
type: 'image',
|
155
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>',
|
146
156
|
content: defaultValue,
|
147
157
|
position: { x: 0, y: 0 },
|
148
158
|
width: 40,
|
@@ -163,6 +173,7 @@ export const readOnlyImage = {
|
|
163
173
|
defaultSchema: {
|
164
174
|
...imageSchema.propPanel.defaultSchema,
|
165
175
|
type: 'readOnlyImage',
|
176
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-image-off"><line x1="2" x2="22" y1="2" y2="22"/><path d="M10.41 10.41a2 2 0 1 1-2.83-2.83"/><line x1="13.5" x2="6" y1="13.5" y2="21"/><line x1="18" x2="21" y1="12" y2="15"/><path d="M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59"/><path d="M21 15V5a2 2 0 0 0-2-2H9"/></svg>',
|
166
177
|
readOnly: true,
|
167
178
|
},
|
168
179
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../../src/graphics/image.ts"],"names":[],"mappings":"AAKA,OAAO,
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../../src/graphics/image.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,KAAK,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,GAAG,CAAC,MAAc,EAAE,KAAa,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,EAAE,CAAC;AAChF,MAAM,QAAQ,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACnD,MAAM,YAAY,GAChB,wsHAAwsH,CAAC;AAI3sH,MAAM,WAAW,GAAwB;IACvC,GAAG,EAAE,KAAK,EAAE,GAAgC,EAA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ACrC,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAgB,EAAE,CAAC,CAC9E,CAAC;YACJ,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW,IAAI,WAAW,EAAE,CAAC,CAAC;YACnE,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SAC1B;IACH,CAAC;IACD,SAAS,EAAE;QACT,MAAM,EAAE,EAAE;QACV,aAAa,EAAE;YACb,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,mWAAmW;YACzW,OAAO,EAAE,YAAY;YACrB,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;YACxB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,uGAAuG;YACvG,4GAA4G;YAC5G,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,eAAe;SACzB;KACF;CACF,CAAC;AAEF,eAAe,WAAW,CAAC;AAE3B,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,GAAG,EAAE,WAAW,CAAC,GAAG;IACpB,EAAE,EAAE,WAAW,CAAC,EAAE;IAClB,SAAS,EAAE;QACT,GAAG,WAAW,CAAC,SAAS;QACxB,aAAa,EAAE;YACb,GAAG,WAAW,CAAC,SAAS,CAAC,aAAa;YACtC,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,0fAA0f;YAChgB,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
// ref: https://github.com/image-size/image-size ----------------------------
|
2
|
+
// The following code is adapted from the image-size code. Unnecessary formats and dependencies on Node have been removed.
|
3
|
+
import { Buffer } from 'buffer';
|
4
4
|
const decoder = new TextDecoder();
|
5
5
|
const toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
|
6
6
|
const toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo + ('0' + i.toString(16)).slice(-2), '');
|
@@ -100,6 +100,12 @@ function detector(input) {
|
|
100
100
|
const keys = Object.keys(typeHandlers);
|
101
101
|
return keys.find((key) => typeHandlers[key].validate(input));
|
102
102
|
}
|
103
|
+
export const getImageDimension = (value) => {
|
104
|
+
const dataUriPrefix = ';base64,';
|
105
|
+
const idx = value.indexOf(dataUriPrefix);
|
106
|
+
const imgBase64 = value.substring(idx + dataUriPrefix.length, value.length);
|
107
|
+
return imageSize(Buffer.from(imgBase64, 'base64'));
|
108
|
+
};
|
103
109
|
const imageSize = (imgBuffer) => {
|
104
110
|
const type = detector(imgBuffer);
|
105
111
|
if (typeof type !== 'undefined' && type in typeHandlers) {
|
@@ -110,6 +116,5 @@ const imageSize = (imgBuffer) => {
|
|
110
116
|
}
|
111
117
|
throw new TypeError('[@pdfme/schemas/images] Unsupported file type: ' + (type === undefined ? 'undefined' : type));
|
112
118
|
};
|
113
|
-
exports.imageSize = imageSize;
|
114
119
|
// ----------------------------
|
115
|
-
//# sourceMappingURL=
|
120
|
+
//# sourceMappingURL=imagehelper.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"imagehelper.js","sourceRoot":"","sources":["../../../../src/graphics/imagehelper.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,0HAA0H;AAC1H,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOhC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,MAAM,YAAY,GAAG,CAAC,KAAiB,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,EAAE,CACxE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;AAE1C,MAAM,WAAW,GAA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return content.startsWith('data:application/pdf;');
|
4
|
+
}
|
5
|
+
/**
|
6
|
+
* convert pdf to blob image url
|
7
|
+
* @param content
|
8
|
+
*/
|
9
|
+
export const pdfToImage = async ({ schema, value, _cache, pdfJs, }) => {
|
10
|
+
// using value from cache to prevent rerending pdf to image
|
11
|
+
const pdfImageCacheKey = getCacheKey(schema, value);
|
12
|
+
const imageSrc = _cache.get(pdfImageCacheKey);
|
13
|
+
if (imageSrc)
|
14
|
+
return imageSrc;
|
15
|
+
const pdfDoc = await pdfJs.getDocument({ url: value }).promise;
|
16
|
+
const page = await pdfDoc.getPage(1);
|
17
|
+
const canvas = document.createElement('canvas');
|
18
|
+
const viewport = page.getViewport({ scale: 1 });
|
19
|
+
canvas.width = viewport.width;
|
20
|
+
canvas.height = viewport.height;
|
21
|
+
const canvasContext = canvas.getContext('2d');
|
22
|
+
await page.render({ canvasContext, viewport }).promise;
|
23
|
+
const image = await _canvasToObjectUrl(canvas);
|
24
|
+
_cache.set(pdfImageCacheKey, image);
|
25
|
+
return image;
|
26
|
+
};
|
27
|
+
/**
|
28
|
+
* convert canvas to blob url
|
29
|
+
* @param canvas
|
30
|
+
*/
|
31
|
+
const _canvasToObjectUrl = async (canvas) => {
|
32
|
+
return new Promise((resolve, reject) => {
|
33
|
+
canvas.toBlob(function (blob) {
|
34
|
+
if (!blob) {
|
35
|
+
reject('inavlid canvas');
|
36
|
+
}
|
37
|
+
else {
|
38
|
+
const url = URL.createObjectURL(blob);
|
39
|
+
resolve(url);
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
};
|
44
|
+
//# sourceMappingURL=pdfHelper.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pdfHelper.js","sourceRoot":"","sources":["../../../../src/graphics/pdfHelper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,MAAM,UAAU,KAAK,CAAC,OAAe;IACnC,OAAO,OAAO,CAAC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AAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,CAAC,MAAM,CAAC,UAAU,IAAI;YAC1B,IAAI,CAAC,IAAI,EAAE;gBACT,MAAM,CAAC,gBAAgB,CAAC,CAAC;aAC1B;iBAAM;gBACL,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;gBACtC,OAAO,CAAC,GAAG,CAAC,CAAC;aACd;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
@@ -69,6 +69,7 @@ const svgSchema = {
|
|
69
69
|
schema: {},
|
70
70
|
defaultSchema: {
|
71
71
|
type: 'svg',
|
72
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-route"><circle cx="6" cy="19" r="3"/><path d="M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"/><circle cx="18" cy="5" r="3"/></svg>',
|
72
73
|
content: defaultValue,
|
73
74
|
position: { x: 0, y: 0 },
|
74
75
|
width: 40,
|
@@ -85,6 +86,7 @@ export const readOnlySvg = {
|
|
85
86
|
defaultSchema: {
|
86
87
|
...svgSchema.propPanel.defaultSchema,
|
87
88
|
type: 'readOnlySvg',
|
89
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-route-off"><circle cx="6" cy="19" r="3"/><path d="M9 19h8.5c.4 0 .9-.1 1.3-.2"/><path d="M5.2 5.2A3.5 3.53 0 0 0 6.5 12H12"/><path d="m2 2 20 20"/><path d="M21 15.3a3.5 3.5 0 0 0-3.3-3.3"/><path d="M15 5h-4.3"/><circle cx="18" cy="5" r="3"/></svg>',
|
88
90
|
readOnly: true,
|
89
91
|
},
|
90
92
|
},
|