@ironsoftware/ironpdf 2024.1.1 → 2024.3.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/package.json +4 -3
- package/src/internal/IronPdfEngine.ProtoFiles/chrome_render.proto +2 -1
- package/src/internal/IronPdfEngine.ProtoFiles/iron_pdf_service.proto +3 -0
- package/src/internal/IronPdfEngine.ProtoFiles/pdfium_compress.proto +1 -0
- package/src/internal/IronPdfEngine.ProtoFiles/pdfium_form.proto +1 -5
- package/src/internal/IronPdfEngine.ProtoFiles/pdfium_pdf_document.proto +58 -0
- package/src/internal/IronPdfEngine.ProtoFiles/pdfium_signature.proto +1 -0
- package/src/internal/IronPdfEngine.ProtoFiles/pdfium_text.proto +7 -0
- package/src/internal/generated_proto/iron_pdf_service.d.ts +9 -1
- package/src/internal/generated_proto/iron_pdf_service.d.ts.map +1 -1
- package/src/internal/generated_proto/iron_pdf_service.ts +9 -1
- package/src/internal/generated_proto/ironpdfengineproto/ChromeTextHeaderFooterP.d.ts +3 -3
- package/src/internal/generated_proto/ironpdfengineproto/ChromeTextHeaderFooterP.d.ts.map +1 -1
- package/src/internal/generated_proto/ironpdfengineproto/ChromeTextHeaderFooterP.ts +3 -3
- package/src/internal/generated_proto/ironpdfengineproto/IronPdfService.d.ts +35 -0
- package/src/internal/generated_proto/ironpdfengineproto/IronPdfService.d.ts.map +1 -1
- package/src/internal/generated_proto/ironpdfengineproto/IronPdfService.ts +41 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCharObjectCollectionP.d.ts +8 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCharObjectCollectionP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCharObjectCollectionP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCharObjectCollectionP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCharObjectCollectionP.ts +11 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCharObjectP.d.ts +25 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCharObjectP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCharObjectP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCharObjectP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCharObjectP.ts +28 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCompressImagesRequestP.d.ts +2 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCompressImagesRequestP.d.ts.map +1 -1
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumCompressImagesRequestP.ts +2 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumFormFieldP.d.ts +2 -3
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumFormFieldP.d.ts.map +1 -1
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumFormFieldP.ts +2 -3
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetCharObjectCollectionRequestP.d.ts +10 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetCharObjectCollectionRequestP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetCharObjectCollectionRequestP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetCharObjectCollectionRequestP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetCharObjectCollectionRequestP.ts +13 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetCharObjectCollectionResultP.d.ts +12 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetCharObjectCollectionResultP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetCharObjectCollectionResultP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetCharObjectCollectionResultP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetCharObjectCollectionResultP.ts +15 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetTextObjectCollectionRequestP.d.ts +10 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetTextObjectCollectionRequestP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetTextObjectCollectionRequestP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetTextObjectCollectionRequestP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetTextObjectCollectionRequestP.ts +13 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetTextObjectCollectionResultP.d.ts +12 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetTextObjectCollectionResultP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetTextObjectCollectionResultP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetTextObjectCollectionResultP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumGetTextObjectCollectionResultP.ts +15 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumRedactTextRequestP.d.ts +14 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumRedactTextRequestP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumRedactTextRequestP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumRedactTextRequestP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumRedactTextRequestP.ts +17 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumSignRequestStreamP.d.ts +3 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumSignRequestStreamP.d.ts.map +1 -1
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumSignRequestStreamP.ts +3 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextObjectCollectionP.d.ts +8 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextObjectCollectionP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextObjectCollectionP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextObjectCollectionP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextObjectCollectionP.ts +11 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextObjectP.d.ts +17 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextObjectP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextObjectP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextObjectP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextObjectP.ts +20 -0
- package/src/internal/grpc_layer/chrome/stamp.d.ts +3 -3
- package/src/internal/grpc_layer/chrome/stamp.d.ts.map +1 -1
- package/src/internal/grpc_layer/chrome/stamp.js +3 -3
- package/src/internal/grpc_layer/chrome/stamp.js.map +1 -1
- package/src/internal/grpc_layer/chrome/stamp.ts +6 -6
- package/src/internal/grpc_layer/pdfium/page.d.ts +1 -1
- package/src/internal/grpc_layer/pdfium/page.d.ts.map +1 -1
- package/src/internal/grpc_layer/pdfium/page.js +1 -1
- package/src/internal/grpc_layer/pdfium/page.js.map +1 -1
- package/src/internal/grpc_layer/pdfium/page.ts +2 -3
- package/src/internal/zod/affixSchema.d.ts +6 -0
- package/src/internal/zod/affixSchema.d.ts.map +1 -0
- package/src/internal/zod/affixSchema.js +36 -0
- package/src/internal/zod/affixSchema.js.map +1 -0
- package/src/internal/zod/affixSchema.ts +35 -0
- package/src/internal/zod/imageSchema.d.ts +6 -0
- package/src/internal/zod/imageSchema.d.ts.map +1 -0
- package/src/internal/zod/imageSchema.js +13 -0
- package/src/internal/zod/imageSchema.js.map +1 -0
- package/src/internal/zod/imageSchema.ts +18 -0
- package/src/internal/zod/ironpdfglobalconfigSchema.d.ts +4 -0
- package/src/internal/zod/ironpdfglobalconfigSchema.d.ts.map +1 -0
- package/src/internal/zod/ironpdfglobalconfigSchema.js +34 -0
- package/src/internal/zod/ironpdfglobalconfigSchema.js.map +1 -0
- package/src/internal/zod/ironpdfglobalconfigSchema.ts +32 -0
- package/src/internal/zod/pageSchema.d.ts +5 -0
- package/src/internal/zod/pageSchema.d.ts.map +1 -0
- package/src/internal/zod/pageSchema.js +18 -0
- package/src/internal/zod/pageSchema.js.map +1 -0
- package/src/internal/zod/pageSchema.ts +17 -0
- package/src/internal/zod/paperSchema.d.ts +8 -0
- package/src/internal/zod/paperSchema.d.ts.map +1 -0
- package/src/internal/zod/paperSchema.js +18 -0
- package/src/internal/zod/paperSchema.js.map +1 -0
- package/src/internal/zod/paperSchema.ts +22 -0
- package/src/internal/zod/pdfDocumentSchema.d.ts +4 -0
- package/src/internal/zod/pdfDocumentSchema.d.ts.map +1 -0
- package/src/internal/zod/pdfDocumentSchema.js +7 -0
- package/src/internal/zod/pdfDocumentSchema.js.map +1 -0
- package/src/internal/zod/pdfDocumentSchema.ts +6 -0
- package/src/internal/zod/renderSchema.d.ts +14 -0
- package/src/internal/zod/renderSchema.d.ts.map +1 -0
- package/src/internal/zod/renderSchema.js +88 -0
- package/src/internal/zod/renderSchema.js.map +1 -0
- package/src/internal/zod/renderSchema.ts +107 -0
- package/src/internal/zod/securitySchema.d.ts +4 -0
- package/src/internal/zod/securitySchema.d.ts.map +1 -0
- package/src/internal/zod/securitySchema.js +17 -0
- package/src/internal/zod/securitySchema.js.map +1 -0
- package/src/internal/zod/securitySchema.ts +15 -0
- package/src/internal/zod/signatureSchema.d.ts +5 -0
- package/src/internal/zod/signatureSchema.d.ts.map +1 -0
- package/src/internal/zod/signatureSchema.js +22 -0
- package/src/internal/zod/signatureSchema.js.map +1 -0
- package/src/internal/zod/signatureSchema.ts +22 -0
- package/src/internal/zod/stampSchema.d.ts +155 -0
- package/src/internal/zod/stampSchema.d.ts.map +1 -0
- package/src/internal/zod/stampSchema.js +79 -0
- package/src/internal/zod/stampSchema.js.map +1 -0
- package/src/internal/zod/stampSchema.ts +87 -0
- package/src/internal/zod/typeSchema.d.ts +38 -0
- package/src/internal/zod/typeSchema.d.ts.map +1 -0
- package/src/internal/zod/typeSchema.js +74 -0
- package/src/internal/zod/typeSchema.js.map +1 -0
- package/src/internal/zod/typeSchema.ts +120 -0
- package/src/public/affix.d.ts +5 -5
- package/src/public/affix.ts +5 -5
- package/src/public/image.d.ts +1 -9
- package/src/public/image.d.ts.map +1 -1
- package/src/public/image.js.map +1 -1
- package/src/public/image.ts +1 -9
- package/src/public/ironpdfglobalconfig.d.ts +8 -8
- package/src/public/ironpdfglobalconfig.ts +8 -8
- package/src/public/pdfDocument.d.ts +354 -43
- package/src/public/pdfDocument.d.ts.map +1 -1
- package/src/public/pdfDocument.js +835 -150
- package/src/public/pdfDocument.js.map +1 -1
- package/src/public/pdfDocument.ts +1125 -197
- package/src/public/pdfGenerator.d.ts +4 -4
- package/src/public/pdfGenerator.ts +4 -4
- package/src/public/render.d.ts +5 -5
- package/src/public/render.ts +5 -5
- package/src/public/stamp.d.ts +10 -10
- package/src/public/stamp.ts +11 -11
- package/src/public/types.d.ts +7 -7
- package/src/public/types.d.ts.map +1 -1
- package/src/public/types.js.map +1 -1
- package/src/public/types.ts +7 -8
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumFormFieldTypesP.d.ts +0 -7
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumFormFieldTypesP.d.ts.map +0 -1
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumFormFieldTypesP.js +0 -4
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumFormFieldTypesP.js.map +0 -1
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumFormFieldTypesP.ts +0 -10
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.textStampOptionsSchema = exports.barcodeStampOptionsSchema = exports.imageStampOptionsSchema = exports.htmlStampOptionsSchema = exports.baseStampOptionsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const typeSchema_1 = require("./typeSchema");
|
|
6
|
+
exports.baseStampOptionsSchema = zod_1.z.object({
|
|
7
|
+
horizontalAlignment: typeSchema_1.horizontalAlignmentSchema,
|
|
8
|
+
verticalAlignment: typeSchema_1.verticalAlignmentSchema,
|
|
9
|
+
horizontalOffset: typeSchema_1.lengthSchema.optional(),
|
|
10
|
+
verticalOffset: typeSchema_1.lengthSchema.optional(),
|
|
11
|
+
opacity: zod_1.z
|
|
12
|
+
.number()
|
|
13
|
+
.optional(),
|
|
14
|
+
rotation: zod_1.z
|
|
15
|
+
.number()
|
|
16
|
+
.optional(),
|
|
17
|
+
hyperlink: zod_1.z
|
|
18
|
+
.string()
|
|
19
|
+
.optional(),
|
|
20
|
+
scale: zod_1.z
|
|
21
|
+
.number()
|
|
22
|
+
.optional(),
|
|
23
|
+
behindExistingContent: zod_1.z
|
|
24
|
+
.boolean()
|
|
25
|
+
.optional(),
|
|
26
|
+
timeout: zod_1.z
|
|
27
|
+
.number()
|
|
28
|
+
.optional(),
|
|
29
|
+
renderDelay: zod_1.z
|
|
30
|
+
.number()
|
|
31
|
+
.optional(),
|
|
32
|
+
maxWidth: typeSchema_1.lengthSchema.optional(),
|
|
33
|
+
maxHeight: typeSchema_1.lengthSchema.optional(),
|
|
34
|
+
minWidth: typeSchema_1.lengthSchema.optional(),
|
|
35
|
+
minHeight: typeSchema_1.lengthSchema.optional()
|
|
36
|
+
});
|
|
37
|
+
exports.htmlStampOptionsSchema = exports.baseStampOptionsSchema.extend({
|
|
38
|
+
cssMediaType: typeSchema_1.cssMediaTypeSchema.optional()
|
|
39
|
+
});
|
|
40
|
+
exports.imageStampOptionsSchema = exports.baseStampOptionsSchema;
|
|
41
|
+
exports.barcodeStampOptionsSchema = exports.baseStampOptionsSchema.extend({
|
|
42
|
+
widthPx: zod_1.z
|
|
43
|
+
.number()
|
|
44
|
+
.optional(),
|
|
45
|
+
heightPx: zod_1.z
|
|
46
|
+
.number()
|
|
47
|
+
.optional(),
|
|
48
|
+
barcodeType: typeSchema_1.barcodeTypeSchema.optional()
|
|
49
|
+
});
|
|
50
|
+
exports.textStampOptionsSchema = exports.baseStampOptionsSchema.extend({
|
|
51
|
+
isBold: zod_1.z
|
|
52
|
+
.boolean()
|
|
53
|
+
.optional(),
|
|
54
|
+
isItalic: zod_1.z
|
|
55
|
+
.boolean()
|
|
56
|
+
.optional(),
|
|
57
|
+
isUnderline: zod_1.z
|
|
58
|
+
.boolean()
|
|
59
|
+
.optional(),
|
|
60
|
+
isStrikethrough: zod_1.z
|
|
61
|
+
.boolean()
|
|
62
|
+
.optional(),
|
|
63
|
+
fontFamily: zod_1.z
|
|
64
|
+
.string()
|
|
65
|
+
.optional(),
|
|
66
|
+
fontSize: zod_1.z
|
|
67
|
+
.number()
|
|
68
|
+
.optional(),
|
|
69
|
+
useGoogleFont: zod_1.z
|
|
70
|
+
.boolean()
|
|
71
|
+
.optional(),
|
|
72
|
+
textColor: zod_1.z
|
|
73
|
+
.string()
|
|
74
|
+
.optional(),
|
|
75
|
+
backgroundColor: zod_1.z
|
|
76
|
+
.string()
|
|
77
|
+
.optional()
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=stampSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stampSchema.js","sourceRoot":"","sources":["stampSchema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,6CAMsB;AAGT,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,mBAAmB,EAAE,sCAAyB;IAC9C,iBAAiB,EAAE,oCAAuB;IAC1C,gBAAgB,EAAE,yBAAY,CAAC,QAAQ,EAAE;IACzC,cAAc,EAAE,yBAAY,CAAC,QAAQ,EAAE;IACvC,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;IACb,QAAQ,E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AAE,OAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;IACb,QAAQ,EAAE,OAAC;SACR,MAAM,EAAE;SACR,QAAQ,EAAE;IACb,aAAa,EAAE,OAAC;SACb,OAAO,EAAE;SACT,QAAQ,EAAE;IACb,SAAS,EAAE,OAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;IACb,eAAe,EAAE,OAAC;SACf,MAAM,EAAE;SACR,QAAQ,EAAE;CACd,CAAC,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from "zod"
|
|
2
|
+
import {
|
|
3
|
+
barcodeTypeSchema,
|
|
4
|
+
cssMediaTypeSchema,
|
|
5
|
+
horizontalAlignmentSchema,
|
|
6
|
+
lengthSchema,
|
|
7
|
+
verticalAlignmentSchema
|
|
8
|
+
} from "./typeSchema";
|
|
9
|
+
import {BarcodeStampOptions, TextStampOptions} from "../../public/stamp";
|
|
10
|
+
|
|
11
|
+
export const baseStampOptionsSchema = z.object({
|
|
12
|
+
horizontalAlignment: horizontalAlignmentSchema,
|
|
13
|
+
verticalAlignment: verticalAlignmentSchema,
|
|
14
|
+
horizontalOffset: lengthSchema.optional(),
|
|
15
|
+
verticalOffset: lengthSchema.optional(),
|
|
16
|
+
opacity: z
|
|
17
|
+
.number()
|
|
18
|
+
.optional(),
|
|
19
|
+
rotation: z
|
|
20
|
+
.number()
|
|
21
|
+
.optional(),
|
|
22
|
+
hyperlink: z
|
|
23
|
+
.string()
|
|
24
|
+
.optional(),
|
|
25
|
+
scale: z
|
|
26
|
+
.number()
|
|
27
|
+
.optional(),
|
|
28
|
+
behindExistingContent: z
|
|
29
|
+
.boolean()
|
|
30
|
+
.optional(),
|
|
31
|
+
timeout: z
|
|
32
|
+
.number()
|
|
33
|
+
.optional(),
|
|
34
|
+
renderDelay: z
|
|
35
|
+
.number()
|
|
36
|
+
.optional(),
|
|
37
|
+
maxWidth: lengthSchema.optional(),
|
|
38
|
+
maxHeight: lengthSchema.optional(),
|
|
39
|
+
minWidth: lengthSchema.optional(),
|
|
40
|
+
minHeight: lengthSchema.optional()
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
export const htmlStampOptionsSchema = baseStampOptionsSchema.extend({
|
|
44
|
+
cssMediaType: cssMediaTypeSchema.optional()
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
export const imageStampOptionsSchema = baseStampOptionsSchema
|
|
48
|
+
|
|
49
|
+
export const barcodeStampOptionsSchema: z.ZodType<BarcodeStampOptions> = baseStampOptionsSchema.extend({
|
|
50
|
+
widthPx: z
|
|
51
|
+
.number()
|
|
52
|
+
.optional(),
|
|
53
|
+
heightPx: z
|
|
54
|
+
.number()
|
|
55
|
+
.optional(),
|
|
56
|
+
barcodeType: barcodeTypeSchema.optional()
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
export const textStampOptionsSchema: z.ZodType<TextStampOptions> = baseStampOptionsSchema.extend({
|
|
60
|
+
isBold: z
|
|
61
|
+
.boolean()
|
|
62
|
+
.optional(),
|
|
63
|
+
isItalic: z
|
|
64
|
+
.boolean()
|
|
65
|
+
.optional(),
|
|
66
|
+
isUnderline: z
|
|
67
|
+
.boolean()
|
|
68
|
+
.optional(),
|
|
69
|
+
isStrikethrough: z
|
|
70
|
+
.boolean()
|
|
71
|
+
.optional(),
|
|
72
|
+
fontFamily: z
|
|
73
|
+
.string()
|
|
74
|
+
.optional(),
|
|
75
|
+
fontSize: z
|
|
76
|
+
.number()
|
|
77
|
+
.optional(),
|
|
78
|
+
useGoogleFont: z
|
|
79
|
+
.boolean()
|
|
80
|
+
.optional(),
|
|
81
|
+
textColor: z
|
|
82
|
+
.string()
|
|
83
|
+
.optional(),
|
|
84
|
+
backgroundColor: z
|
|
85
|
+
.string()
|
|
86
|
+
.optional()
|
|
87
|
+
})
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { HorizontalAlignment, VerticalAlignment, CssMediaType, FitToPaperModes, MeasurementUnit, UseMargins, ChromeGpuModes, ChangeTrackingModes, HtmlString, HtmlFilePath, ZipFilePath, PdfFilePath, UrlString, BarcodeType, PdfPageSelection, SaveOptions, Length, CropRectangle, MarginConfig, ImageFilePath, ImageBuffer, PdfPassword, PdfInput } from "../../public/types";
|
|
4
|
+
import { Buffer } from "buffer";
|
|
5
|
+
export declare const horizontalAlignmentSchema: z.ZodType<HorizontalAlignment>;
|
|
6
|
+
export declare const verticalAlignmentSchema: z.ZodType<VerticalAlignment>;
|
|
7
|
+
export declare const cssMediaTypeSchema: z.ZodType<CssMediaType>;
|
|
8
|
+
export declare const fitToPaperModesSchema: z.ZodType<FitToPaperModes>;
|
|
9
|
+
export declare const pdfPageSelectionSchema: z.ZodType<PdfPageSelection>;
|
|
10
|
+
export declare const measurementUnitSchema: z.ZodType<MeasurementUnit>;
|
|
11
|
+
export declare const saveOptionsSchema: z.ZodType<SaveOptions>;
|
|
12
|
+
export declare const lengthSchema: z.ZodType<Length>;
|
|
13
|
+
export declare const cropRectangleSchema: z.ZodType<CropRectangle>;
|
|
14
|
+
export declare const marginConfigSchema: z.ZodType<MarginConfig>;
|
|
15
|
+
export declare const filePathSchema: z.ZodType<string>;
|
|
16
|
+
export declare const pdfFilePathSchema: z.ZodType<PdfFilePath>;
|
|
17
|
+
export declare const zipFilePathSchema: z.ZodType<ZipFilePath>;
|
|
18
|
+
export declare const htmlStringSchema: z.ZodType<HtmlString>;
|
|
19
|
+
export declare const htmlFilePathSchema: z.ZodType<HtmlFilePath>;
|
|
20
|
+
export declare const urlStringSchema: z.ZodType<UrlString>;
|
|
21
|
+
export declare const stringSchema: z.ZodType<string>;
|
|
22
|
+
export declare const urlSchema: z.ZodType<URL>;
|
|
23
|
+
export declare const imageFilePathSchema: z.ZodType<ImageFilePath>;
|
|
24
|
+
export declare const bufferSchema: z.ZodType<Buffer>;
|
|
25
|
+
export declare const imageBufferSchema: z.ZodType<ImageBuffer>;
|
|
26
|
+
export declare const useMarginsSchema: z.ZodType<UseMargins>;
|
|
27
|
+
export declare const pdfPasswordSchema: z.ZodType<PdfPassword>;
|
|
28
|
+
export declare const chromeGpuModesSchema: z.ZodType<ChromeGpuModes>;
|
|
29
|
+
export declare const changeTrackingModesSchema: z.ZodType<ChangeTrackingModes>;
|
|
30
|
+
export declare const pdfInputSchema: z.ZodType<PdfInput>;
|
|
31
|
+
export declare const dateSchema: z.ZodType<Date>;
|
|
32
|
+
export declare const barcodeTypeSchema: z.ZodType<BarcodeType>;
|
|
33
|
+
export declare const stringArraySchema: z.ZodType<string[]>;
|
|
34
|
+
export declare const bufferArraySchema: z.ZodType<Buffer[]>;
|
|
35
|
+
export declare const numberSchema: z.ZodType<number>;
|
|
36
|
+
export declare const booleanSchema: z.ZodType<boolean>;
|
|
37
|
+
export declare const mapStringSchema: z.ZodType<Map<string, string>>;
|
|
38
|
+
//# sourceMappingURL=typeSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeSchema.d.ts","sourceRoot":"","sources":["typeSchema.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EACN,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,eAAe,EACf,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EACnG,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAE9B,eAAO,MAAM,yBAAyB,EAAE,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAqC,CAAA;AAE1G,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,C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2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapStringSchema = exports.booleanSchema = exports.numberSchema = exports.bufferArraySchema = exports.stringArraySchema = exports.barcodeTypeSchema = exports.dateSchema = exports.pdfInputSchema = exports.changeTrackingModesSchema = exports.chromeGpuModesSchema = exports.pdfPasswordSchema = exports.useMarginsSchema = exports.imageBufferSchema = exports.bufferSchema = exports.imageFilePathSchema = exports.urlSchema = exports.stringSchema = exports.urlStringSchema = exports.htmlFilePathSchema = exports.htmlStringSchema = exports.zipFilePathSchema = exports.pdfFilePathSchema = exports.filePathSchema = exports.marginConfigSchema = exports.cropRectangleSchema = exports.lengthSchema = exports.saveOptionsSchema = exports.measurementUnitSchema = exports.pdfPageSelectionSchema = exports.fitToPaperModesSchema = exports.cssMediaTypeSchema = exports.verticalAlignmentSchema = exports.horizontalAlignmentSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const types_1 = require("../../public/types");
|
|
6
|
+
const pdfDocumentSchema_1 = require("./pdfDocumentSchema");
|
|
7
|
+
const buffer_1 = require("buffer");
|
|
8
|
+
exports.horizontalAlignmentSchema = zod_1.z.nativeEnum(types_1.HorizontalAlignment);
|
|
9
|
+
exports.verticalAlignmentSchema = zod_1.z.nativeEnum(types_1.VerticalAlignment);
|
|
10
|
+
exports.cssMediaTypeSchema = zod_1.z.nativeEnum(types_1.CssMediaType);
|
|
11
|
+
exports.fitToPaperModesSchema = zod_1.z.nativeEnum(types_1.FitToPaperModes);
|
|
12
|
+
exports.pdfPageSelectionSchema = zod_1.z.union([
|
|
13
|
+
zod_1.z.number(),
|
|
14
|
+
zod_1.z.array(zod_1.z.number()),
|
|
15
|
+
zod_1.z.literal("all"),
|
|
16
|
+
zod_1.z.undefined()
|
|
17
|
+
]);
|
|
18
|
+
exports.measurementUnitSchema = zod_1.z.nativeEnum(types_1.MeasurementUnit);
|
|
19
|
+
exports.saveOptionsSchema = zod_1.z.object({
|
|
20
|
+
userPassword: zod_1.z.string().optional(),
|
|
21
|
+
ownerPassword: zod_1.z
|
|
22
|
+
.string()
|
|
23
|
+
.optional(),
|
|
24
|
+
saveAsPdfA: zod_1.z
|
|
25
|
+
.boolean()
|
|
26
|
+
.optional(),
|
|
27
|
+
incremental: zod_1.z
|
|
28
|
+
.boolean()
|
|
29
|
+
.optional()
|
|
30
|
+
});
|
|
31
|
+
exports.lengthSchema = zod_1.z.object({
|
|
32
|
+
value: zod_1.z.number(),
|
|
33
|
+
unit: exports.measurementUnitSchema
|
|
34
|
+
});
|
|
35
|
+
exports.cropRectangleSchema = zod_1.z.object({
|
|
36
|
+
x: zod_1.z.number().optional(),
|
|
37
|
+
y: zod_1.z.number().optional(),
|
|
38
|
+
width: zod_1.z.number().optional(),
|
|
39
|
+
height: zod_1.z.number().optional()
|
|
40
|
+
});
|
|
41
|
+
exports.marginConfigSchema = zod_1.z.object({
|
|
42
|
+
default: zod_1.z.number().optional(),
|
|
43
|
+
top: zod_1.z.number().optional(),
|
|
44
|
+
right: zod_1.z.number().optional(),
|
|
45
|
+
bottom: zod_1.z.number().optional(),
|
|
46
|
+
left: zod_1.z.number().optional()
|
|
47
|
+
});
|
|
48
|
+
exports.filePathSchema = zod_1.z.string();
|
|
49
|
+
exports.pdfFilePathSchema = zod_1.z.string();
|
|
50
|
+
exports.zipFilePathSchema = zod_1.z.string();
|
|
51
|
+
exports.htmlStringSchema = zod_1.z.string();
|
|
52
|
+
exports.htmlFilePathSchema = zod_1.z.string();
|
|
53
|
+
exports.urlStringSchema = zod_1.z.string();
|
|
54
|
+
exports.stringSchema = zod_1.z.string();
|
|
55
|
+
exports.urlSchema = zod_1.z.instanceof(URL);
|
|
56
|
+
exports.imageFilePathSchema = zod_1.z.string();
|
|
57
|
+
exports.bufferSchema = zod_1.z.instanceof(buffer_1.Buffer);
|
|
58
|
+
exports.imageBufferSchema = exports.bufferSchema;
|
|
59
|
+
exports.useMarginsSchema = zod_1.z.nativeEnum(types_1.UseMargins);
|
|
60
|
+
exports.pdfPasswordSchema = zod_1.z.object({
|
|
61
|
+
userPassword: zod_1.z.string().optional(),
|
|
62
|
+
ownerPassword: zod_1.z.string().optional()
|
|
63
|
+
});
|
|
64
|
+
exports.chromeGpuModesSchema = zod_1.z.nativeEnum(types_1.ChromeGpuModes);
|
|
65
|
+
exports.changeTrackingModesSchema = zod_1.z.nativeEnum(types_1.ChangeTrackingModes);
|
|
66
|
+
exports.pdfInputSchema = zod_1.z.union([pdfDocumentSchema_1.pdfDocumentSchema, exports.bufferSchema, exports.htmlStringSchema, exports.htmlFilePathSchema, exports.zipFilePathSchema, exports.pdfFilePathSchema, exports.urlSchema, exports.urlStringSchema]);
|
|
67
|
+
exports.dateSchema = zod_1.z.instanceof(Date);
|
|
68
|
+
exports.barcodeTypeSchema = zod_1.z.nativeEnum(types_1.BarcodeType);
|
|
69
|
+
exports.stringArraySchema = zod_1.z.array(zod_1.z.string());
|
|
70
|
+
exports.bufferArraySchema = zod_1.z.array(exports.bufferSchema);
|
|
71
|
+
exports.numberSchema = zod_1.z.number();
|
|
72
|
+
exports.booleanSchema = zod_1.z.boolean();
|
|
73
|
+
exports.mapStringSchema = zod_1.z.map(zod_1.z.string(), zod_1.z.string());
|
|
74
|
+
//# sourceMappingURL=typeSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeSchema.js","sourceRoot":"","sources":["typeSchema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,8CAiB2B;AAC3B,2DAAsD;AACtD,mCAA8B;AAEjB,QAAA,yBAAyB,GAAmC,OAAC,CAAC,UAAU,CAAC,2BAAmB,CAAC,CAAA;AAE7F,QAAA,uBAAuB,GAAiC,OAAC,CAAC,UAAU,CAAC,yBAAiB,CAAC,CAAA;AAEvF,QAAA,kBAAkB,GAA4B,OAAC,CAAC,UAAU,CAAC,oBAAY,CAAC,CAAA;AAExE,QAAA,qBAAqB,GAA+B,OAAC,CAAC,UAAU,CAAC,uBAAe,C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,OAAC,CAAC,UAAU,CAAC,2BAAmB,CAAC,CAAA;AAE7F,QAAA,cAAc,GAAwB,OAAC,CAAC,KAAK,CAAC,CAAC,qCAAiB,EAAC,oBAAY,EAAC,wBAAgB,EAAC,0BAAkB,EAAC,yBAAiB,EAAC,yBAAiB,EAAC,iBAAS,EAAC,uBAAe,CAAC,CAAC,CAAA;AAEjL,QAAA,UAAU,GAAoB,OAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;AAEhD,QAAA,iBAAiB,GAA2B,OAAC,CAAC,UAAU,CAAC,mBAAW,CAAC,CAAA;AAErE,QAAA,iBAAiB,GAAwB,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAA;AAE5D,QAAA,iBAAiB,GAAwB,OAAC,CAAC,KAAK,CAAC,oBAAY,CAAC,CAAA;AAE9D,QAAA,YAAY,GAAsB,OAAC,CAAC,MAAM,EAAE,CAAA;AAE5C,QAAA,aAAa,GAAuB,OAAC,CAAC,OAAO,EAAE,CAAA;AAE/C,QAAA,eAAe,GAAkC,OAAC,CAAC,GAAG,CAAC,OAAC,CAAC,MAAM,EAAE,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { z } from "zod"
|
|
2
|
+
import {
|
|
3
|
+
HorizontalAlignment,
|
|
4
|
+
VerticalAlignment,
|
|
5
|
+
CssMediaType,
|
|
6
|
+
FitToPaperModes,
|
|
7
|
+
MeasurementUnit,
|
|
8
|
+
UseMargins,
|
|
9
|
+
ChromeGpuModes,
|
|
10
|
+
ChangeTrackingModes,
|
|
11
|
+
HtmlString,
|
|
12
|
+
HtmlFilePath,
|
|
13
|
+
ZipFilePath,
|
|
14
|
+
PdfFilePath,
|
|
15
|
+
UrlString,
|
|
16
|
+
BarcodeType,
|
|
17
|
+
PdfPageSelection,
|
|
18
|
+
SaveOptions, Length, CropRectangle, MarginConfig, ImageFilePath, ImageBuffer, PdfPassword, PdfInput
|
|
19
|
+
} from "../../public/types"
|
|
20
|
+
import {pdfDocumentSchema} from "./pdfDocumentSchema";
|
|
21
|
+
import {Buffer} from "buffer";
|
|
22
|
+
|
|
23
|
+
export const horizontalAlignmentSchema: z.ZodType<HorizontalAlignment> = z.nativeEnum(HorizontalAlignment)
|
|
24
|
+
|
|
25
|
+
export const verticalAlignmentSchema: z.ZodType<VerticalAlignment> = z.nativeEnum(VerticalAlignment)
|
|
26
|
+
|
|
27
|
+
export const cssMediaTypeSchema: z.ZodType<CssMediaType> = z.nativeEnum(CssMediaType)
|
|
28
|
+
|
|
29
|
+
export const fitToPaperModesSchema: z.ZodType<FitToPaperModes> = z.nativeEnum(FitToPaperModes)
|
|
30
|
+
|
|
31
|
+
export const pdfPageSelectionSchema: z.ZodType<PdfPageSelection> = z.union([
|
|
32
|
+
z.number(),
|
|
33
|
+
z.array(z.number()),
|
|
34
|
+
z.literal("all"),
|
|
35
|
+
z.undefined()
|
|
36
|
+
])
|
|
37
|
+
|
|
38
|
+
export const measurementUnitSchema: z.ZodType<MeasurementUnit> = z.nativeEnum(MeasurementUnit)
|
|
39
|
+
|
|
40
|
+
export const saveOptionsSchema: z.ZodType<SaveOptions> = z.object({
|
|
41
|
+
userPassword: z.string().optional(),
|
|
42
|
+
ownerPassword: z
|
|
43
|
+
.string()
|
|
44
|
+
.optional(),
|
|
45
|
+
saveAsPdfA: z
|
|
46
|
+
.boolean()
|
|
47
|
+
.optional(),
|
|
48
|
+
incremental: z
|
|
49
|
+
.boolean()
|
|
50
|
+
.optional()
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
export const lengthSchema: z.ZodType<Length> = z.object({
|
|
54
|
+
value: z.number(),
|
|
55
|
+
unit: measurementUnitSchema
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
export const cropRectangleSchema: z.ZodType<CropRectangle> = z.object({
|
|
59
|
+
x: z.number().optional(),
|
|
60
|
+
y: z.number().optional(),
|
|
61
|
+
width: z.number().optional(),
|
|
62
|
+
height: z.number().optional()
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
export const marginConfigSchema: z.ZodType<MarginConfig> = z.object({
|
|
66
|
+
default: z.number().optional(),
|
|
67
|
+
top: z.number().optional(),
|
|
68
|
+
right: z.number().optional(),
|
|
69
|
+
bottom: z.number().optional(),
|
|
70
|
+
left: z.number().optional()
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
export const filePathSchema: z.ZodType<string> = z.string()
|
|
74
|
+
|
|
75
|
+
export const pdfFilePathSchema: z.ZodType<PdfFilePath> = z.string()
|
|
76
|
+
|
|
77
|
+
export const zipFilePathSchema: z.ZodType<ZipFilePath> = z.string()
|
|
78
|
+
|
|
79
|
+
export const htmlStringSchema: z.ZodType<HtmlString> = z.string()
|
|
80
|
+
|
|
81
|
+
export const htmlFilePathSchema: z.ZodType<HtmlFilePath> = z.string()
|
|
82
|
+
|
|
83
|
+
export const urlStringSchema: z.ZodType<UrlString> = z.string()
|
|
84
|
+
|
|
85
|
+
export const stringSchema: z.ZodType<string> = z.string()
|
|
86
|
+
|
|
87
|
+
export const urlSchema: z.ZodType<URL> = z.instanceof(URL)
|
|
88
|
+
|
|
89
|
+
export const imageFilePathSchema: z.ZodType<ImageFilePath> = z.string()
|
|
90
|
+
|
|
91
|
+
export const bufferSchema: z.ZodType<Buffer> = z.instanceof(Buffer)
|
|
92
|
+
|
|
93
|
+
export const imageBufferSchema: z.ZodType<ImageBuffer> = bufferSchema
|
|
94
|
+
|
|
95
|
+
export const useMarginsSchema: z.ZodType<UseMargins> = z.nativeEnum(UseMargins)
|
|
96
|
+
|
|
97
|
+
export const pdfPasswordSchema: z.ZodType<PdfPassword> = z.object({
|
|
98
|
+
userPassword: z.string().optional(),
|
|
99
|
+
ownerPassword: z.string().optional()
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
export const chromeGpuModesSchema: z.ZodType<ChromeGpuModes> = z.nativeEnum(ChromeGpuModes)
|
|
103
|
+
|
|
104
|
+
export const changeTrackingModesSchema: z.ZodType<ChangeTrackingModes> = z.nativeEnum(ChangeTrackingModes)
|
|
105
|
+
|
|
106
|
+
export const pdfInputSchema: z.ZodType<PdfInput> = z.union([pdfDocumentSchema,bufferSchema,htmlStringSchema,htmlFilePathSchema,zipFilePathSchema,pdfFilePathSchema,urlSchema,urlStringSchema])
|
|
107
|
+
|
|
108
|
+
export const dateSchema: z.ZodType<Date> = z.instanceof(Date)
|
|
109
|
+
|
|
110
|
+
export const barcodeTypeSchema: z.ZodType<BarcodeType> = z.nativeEnum(BarcodeType)
|
|
111
|
+
|
|
112
|
+
export const stringArraySchema: z.ZodType<string[]> = z.array(z.string())
|
|
113
|
+
|
|
114
|
+
export const bufferArraySchema: z.ZodType<Buffer[]> = z.array(bufferSchema)
|
|
115
|
+
|
|
116
|
+
export const numberSchema: z.ZodType<number> = z.number()
|
|
117
|
+
|
|
118
|
+
export const booleanSchema: z.ZodType<boolean> = z.boolean()
|
|
119
|
+
|
|
120
|
+
export const mapStringSchema: z.ZodType<Map<string,string>> = z.map(z.string(),z.string())
|
package/src/public/affix.d.ts
CHANGED
|
@@ -26,13 +26,13 @@ export interface HtmlAffix {
|
|
|
26
26
|
/**
|
|
27
27
|
* Adds a horizontal line divider between the header / footer and the page content on every page of the PDF document.
|
|
28
28
|
*
|
|
29
|
-
* @default
|
|
29
|
+
* @default false
|
|
30
30
|
*/
|
|
31
31
|
dividerLine?: boolean;
|
|
32
32
|
/**
|
|
33
33
|
* A html color code for divider line color see {@link dividerLine}
|
|
34
34
|
*
|
|
35
|
-
* @default
|
|
35
|
+
* @default #b1b1b1
|
|
36
36
|
*/
|
|
37
37
|
dividerLineColor?: string;
|
|
38
38
|
/**
|
|
@@ -46,7 +46,7 @@ export interface HtmlAffix {
|
|
|
46
46
|
*
|
|
47
47
|
* It is often preferable to load style sheets explicitly into your HTML Headers and Footers as STYLE and LINK tags within the {@link htmlFragment} for granular control.
|
|
48
48
|
*
|
|
49
|
-
* @default
|
|
49
|
+
* @default false
|
|
50
50
|
*/
|
|
51
51
|
loadStylesAndCSSFromMainHtmlDocument?: boolean;
|
|
52
52
|
}
|
|
@@ -82,13 +82,13 @@ export interface TextAffix {
|
|
|
82
82
|
/**
|
|
83
83
|
* Adds a horizontal line divider between the header / footer and the page content on every page of the PDF document.
|
|
84
84
|
*
|
|
85
|
-
* @default
|
|
85
|
+
* @default false
|
|
86
86
|
*/
|
|
87
87
|
dividerLine?: boolean;
|
|
88
88
|
/**
|
|
89
89
|
* A html color code for divider line color see {@link dividerLine}
|
|
90
90
|
*
|
|
91
|
-
* @default
|
|
91
|
+
* @default #b1b1b1
|
|
92
92
|
*/
|
|
93
93
|
dividerLineColor?: string;
|
|
94
94
|
/**
|
package/src/public/affix.ts
CHANGED
|
@@ -35,13 +35,13 @@ export interface HtmlAffix {
|
|
|
35
35
|
/**
|
|
36
36
|
* Adds a horizontal line divider between the header / footer and the page content on every page of the PDF document.
|
|
37
37
|
*
|
|
38
|
-
* @default
|
|
38
|
+
* @default false
|
|
39
39
|
*/
|
|
40
40
|
dividerLine?: boolean;
|
|
41
41
|
/**
|
|
42
42
|
* A html color code for divider line color see {@link dividerLine}
|
|
43
43
|
*
|
|
44
|
-
* @default
|
|
44
|
+
* @default #b1b1b1
|
|
45
45
|
*/
|
|
46
46
|
dividerLineColor?: string;
|
|
47
47
|
/**
|
|
@@ -55,7 +55,7 @@ export interface HtmlAffix {
|
|
|
55
55
|
*
|
|
56
56
|
* It is often preferable to load style sheets explicitly into your HTML Headers and Footers as STYLE and LINK tags within the {@link htmlFragment} for granular control.
|
|
57
57
|
*
|
|
58
|
-
* @default
|
|
58
|
+
* @default false
|
|
59
59
|
*/
|
|
60
60
|
loadStylesAndCSSFromMainHtmlDocument?: boolean;
|
|
61
61
|
}
|
|
@@ -92,13 +92,13 @@ export interface TextAffix {
|
|
|
92
92
|
/**
|
|
93
93
|
* Adds a horizontal line divider between the header / footer and the page content on every page of the PDF document.
|
|
94
94
|
*
|
|
95
|
-
* @default
|
|
95
|
+
* @default false
|
|
96
96
|
*/
|
|
97
97
|
dividerLine?: boolean;
|
|
98
98
|
/**
|
|
99
99
|
* A html color code for divider line color see {@link dividerLine}
|
|
100
100
|
*
|
|
101
|
-
* @default
|
|
101
|
+
* @default #b1b1b1
|
|
102
102
|
*/
|
|
103
103
|
dividerLineColor?: string;
|
|
104
104
|
/**
|
package/src/public/image.d.ts
CHANGED
|
@@ -8,19 +8,11 @@ export interface ImageToPdfOptions {
|
|
|
8
8
|
*/
|
|
9
9
|
imageBehavior: ImageBehavior;
|
|
10
10
|
/**
|
|
11
|
-
* Set an output paper size for PDF pages. Use {@link
|
|
11
|
+
* Set an output paper size for PDF pages. Use {@link CustomPaperSize} for custom sizes.
|
|
12
12
|
*
|
|
13
13
|
* Default value is A4.
|
|
14
14
|
*/
|
|
15
15
|
paperSize: PdfPaperSize;
|
|
16
|
-
/**
|
|
17
|
-
* Custom paper width, in mm
|
|
18
|
-
*/
|
|
19
|
-
customPaperWidth?: number;
|
|
20
|
-
/**
|
|
21
|
-
* Custom paper height, in mm
|
|
22
|
-
*/
|
|
23
|
-
customPaperHeight?: number;
|
|
24
16
|
}
|
|
25
17
|
/**
|
|
26
18
|
* Supported image file type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC;IAC7B;;;;OAIG;IACH,SAAS,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["image.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC;IAC7B;;;;OAIG;IACH,SAAS,EAAE,YAAY,CAAC;CACxB;AACD;;GAEG;AACH,oBAAY,SAAS;IACpB,GAAG,IAAI;IACP,GAAG,IAAI;IACP,GAAG,IAAI;CACP;AACD;;GAEG;AACH,oBAAY,aAAa;IACxB;;OAEG;IACH,cAAc,IAAI;IAClB;;OAEG;IACH,SAAS,IAAI;IACb;;OAEG;IACH,+BAA+B,IAAI;IACnC;;OAEG;IACH,QAAQ,IAAI;IACZ;;OAEG;IACH,mBAAmB,IAAI;IACvB;;OAEG;IACH,sBAAsB,IAAI;IAC1B;;OAEG;IACH,oBAAoB,IAAI;IACxB;;OAEG;IACH,uBAAuB,IAAI;CAC3B"}
|
package/src/public/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["image.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["image.ts"],"names":[],"mappings":";;;AAiBA;;GAEG;AACH,IAAY,SAIX;AAJD,WAAY,SAAS;IACpB,uCAAO,CAAA;IACP,uCAAO,CAAA;IACP,uCAAO,CAAA;AACR,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AACD;;GAEG;AACH,IAAY,aAiCX;AAjCD,WAAY,aAAa;IACxB;;OAEG;IACH,qEAAkB,CAAA;IAClB;;OAEG;IACH,2DAAa,CAAA;IACb;;OAEG;IACH,uGAAmC,CAAA;IACnC;;OAEG;IACH,yDAAY,CAAA;IACZ;;OAEG;IACH,+EAAuB,CAAA;IACvB;;OAEG;IACH,qFAA0B,CAAA;IAC1B;;OAEG;IACH,iFAAwB,CAAA;IACxB;;OAEG;IACH,uFAA2B,CAAA;AAC5B,CAAC,EAjCW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAiCxB"}
|
package/src/public/image.ts
CHANGED
|
@@ -9,19 +9,11 @@ export interface ImageToPdfOptions {
|
|
|
9
9
|
*/
|
|
10
10
|
imageBehavior: ImageBehavior;
|
|
11
11
|
/**
|
|
12
|
-
* Set an output paper size for PDF pages. Use {@link
|
|
12
|
+
* Set an output paper size for PDF pages. Use {@link CustomPaperSize} for custom sizes.
|
|
13
13
|
*
|
|
14
14
|
* Default value is A4.
|
|
15
15
|
*/
|
|
16
16
|
paperSize: PdfPaperSize;
|
|
17
|
-
/**
|
|
18
|
-
* Custom paper width, in mm
|
|
19
|
-
*/
|
|
20
|
-
customPaperWidth?: number;
|
|
21
|
-
/**
|
|
22
|
-
* Custom paper height, in mm
|
|
23
|
-
*/
|
|
24
|
-
customPaperHeight?: number;
|
|
25
17
|
}
|
|
26
18
|
/**
|
|
27
19
|
* Supported image file type
|
|
@@ -24,7 +24,7 @@ export declare class IronPdfGlobalConfig {
|
|
|
24
24
|
export interface IronPdfConfig {
|
|
25
25
|
/**
|
|
26
26
|
* An address of IronPdf subprocess.
|
|
27
|
-
* @default
|
|
27
|
+
* @default 127.0.0.1:33350
|
|
28
28
|
*/
|
|
29
29
|
ironPdfEngineAddress?: string;
|
|
30
30
|
/**
|
|
@@ -34,7 +34,7 @@ export interface IronPdfConfig {
|
|
|
34
34
|
*
|
|
35
35
|
* Docker mode: IronPdf will not spawn subprocess but will connect to Docker instead.
|
|
36
36
|
*
|
|
37
|
-
* @default
|
|
37
|
+
* @default undefined
|
|
38
38
|
*/
|
|
39
39
|
ironPdfEngineDockerAddress?: string;
|
|
40
40
|
/**
|
|
@@ -42,7 +42,7 @@ export interface IronPdfConfig {
|
|
|
42
42
|
*
|
|
43
43
|
* Debug mode: MYAPP will expose more logging messages
|
|
44
44
|
*
|
|
45
|
-
* @default
|
|
45
|
+
* @default false
|
|
46
46
|
*/
|
|
47
47
|
debugMode?: boolean;
|
|
48
48
|
/**
|
|
@@ -56,12 +56,12 @@ export interface IronPdfConfig {
|
|
|
56
56
|
*
|
|
57
57
|
* See https://ironpdf.com/nodejs/licensing/ for licensing options.
|
|
58
58
|
*
|
|
59
|
-
* @default
|
|
59
|
+
* @default undefined
|
|
60
60
|
*/
|
|
61
61
|
licenseKey?: string;
|
|
62
62
|
/**
|
|
63
|
-
* SingleProcess mode Forces Chrome renderer to perform everything in the current process, rather than using subprocesses
|
|
64
|
-
* @default
|
|
63
|
+
* SingleProcess mode Forces Chrome renderer to perform everything in the current process, rather than using subprocesses (default true for macOS, false for other OS)
|
|
64
|
+
* @default false
|
|
65
65
|
*/
|
|
66
66
|
singleProcess?: boolean;
|
|
67
67
|
/**
|
|
@@ -71,7 +71,7 @@ export interface IronPdfConfig {
|
|
|
71
71
|
chromeBrowserLimit?: number;
|
|
72
72
|
/**
|
|
73
73
|
* Disk cache path for Chrome browser instances
|
|
74
|
-
* @default
|
|
74
|
+
* @default undefined
|
|
75
75
|
*/
|
|
76
76
|
chromeBrowserCachePath?: string;
|
|
77
77
|
/**
|
|
@@ -85,7 +85,7 @@ export interface IronPdfConfig {
|
|
|
85
85
|
* This will take a few minutes the next time you run IronPDF.
|
|
86
86
|
* Set this to false if manual Docker / Linux setup is more convenient:
|
|
87
87
|
* <a href="https://ironpdf.com/docs/questions/docker-linux/">more info</a>
|
|
88
|
-
* @default
|
|
88
|
+
* @default true
|
|
89
89
|
*/
|
|
90
90
|
autoInstallDependency?: boolean;
|
|
91
91
|
}
|