@ironsoftware/ironpdf 2024.12.9 → 2025.2.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 +6 -3
- package/src/internal/IronPdfEngine.ProtoFiles/chrome_render.proto +1 -0
- package/src/internal/IronPdfEngine.ProtoFiles/iron_pdf_service.proto +2 -0
- package/src/internal/IronPdfEngine.ProtoFiles/pdfium_annotation.proto +9 -14
- package/src/internal/IronPdfEngine.ProtoFiles/pdfium_page.proto +13 -0
- package/src/internal/IronPdfEngine.ProtoFiles/pdfium_pdf_document.proto +13 -0
- package/src/internal/access.d.ts +2 -3
- package/src/internal/access.d.ts.map +1 -1
- package/src/internal/access.ts +0 -2
- package/src/internal/generated_proto/iron_pdf_service.d.ts +3 -0
- package/src/internal/generated_proto/iron_pdf_service.d.ts.map +1 -1
- package/src/internal/generated_proto/iron_pdf_service.ts +3 -0
- package/src/internal/generated_proto/ironpdfengineproto/ChromePdfRenderOptionsP.d.ts +3 -0
- package/src/internal/generated_proto/ironpdfengineproto/ChromePdfRenderOptionsP.d.ts.map +1 -1
- package/src/internal/generated_proto/ironpdfengineproto/ChromePdfRenderOptionsP.ts +3 -0
- package/src/internal/generated_proto/ironpdfengineproto/IronPdfService.d.ts +23 -0
- package/src/internal/generated_proto/ironpdfengineproto/IronPdfService.d.ts.map +1 -1
- package/src/internal/generated_proto/ironpdfengineproto/IronPdfService.ts +27 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddLinkAnnotationRequestP.d.ts +9 -8
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddLinkAnnotationRequestP.d.ts.map +1 -1
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddLinkAnnotationRequestP.ts +9 -8
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddPageRequestP.d.ts +12 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddPageRequestP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddPageRequestP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddPageRequestP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddPageRequestP.ts +15 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddPageResultP.d.ts +11 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddPageResultP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddPageResultP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddPageResultP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumAddPageResultP.ts +14 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumConvertToPdfUAForScreenReaderRequestP.d.ts +12 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumConvertToPdfUAForScreenReaderRequestP.d.ts.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumConvertToPdfUAForScreenReaderRequestP.js +4 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumConvertToPdfUAForScreenReaderRequestP.js.map +1 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumConvertToPdfUAForScreenReaderRequestP.ts +15 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumEmbedFileToPdfARequestStreamP.d.ts +14 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumEmbedFileToPdfARequestStreamP.d.ts.map +1 -1
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumEmbedFileToPdfARequestStreamP.ts +14 -0
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumPdfAnnotationP.d.ts +9 -8
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumPdfAnnotationP.d.ts.map +1 -1
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumPdfAnnotationP.ts +9 -8
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextAnnotationP.d.ts +4 -12
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextAnnotationP.d.ts.map +1 -1
- package/src/internal/generated_proto/ironpdfengineproto/PdfiumTextAnnotationP.ts +4 -12
- package/src/internal/grpc_layer/chrome/converter.d.ts +23 -23
- package/src/internal/grpc_layer/chrome/converter.d.ts.map +1 -1
- package/src/internal/grpc_layer/chrome/converter.js +93 -102
- package/src/internal/grpc_layer/chrome/converter.js.map +1 -1
- package/src/internal/grpc_layer/chrome/converter.ts +140 -145
- package/src/internal/grpc_layer/chrome/render.d.ts +5 -5
- package/src/internal/grpc_layer/chrome/render.d.ts.map +1 -1
- package/src/internal/grpc_layer/chrome/render.js.map +1 -1
- package/src/internal/grpc_layer/chrome/render.ts +7 -7
- package/src/internal/grpc_layer/chrome/stamp.d.ts +16 -16
- package/src/internal/grpc_layer/chrome/stamp.d.ts.map +1 -1
- package/src/internal/grpc_layer/chrome/stamp.js.map +1 -1
- package/src/internal/grpc_layer/chrome/stamp.ts +16 -16
- package/src/internal/grpc_layer/handshake.js +1 -1
- package/src/internal/grpc_layer/handshake.js.map +1 -1
- package/src/internal/grpc_layer/handshake.ts +1 -1
- package/src/internal/grpc_layer/pdfium/converter.d.ts.map +1 -1
- package/src/internal/grpc_layer/pdfium/converter.js +3 -4
- package/src/internal/grpc_layer/pdfium/converter.js.map +1 -1
- package/src/internal/grpc_layer/pdfium/converter.ts +3 -4
- package/src/internal/grpc_layer/pdfium/headerFooter.d.ts.map +1 -1
- package/src/internal/grpc_layer/pdfium/headerFooter.js.map +1 -1
- package/src/internal/grpc_layer/pdfium/headerFooter.ts +0 -2
- package/src/internal/grpc_layer/pdfium/image.d.ts.map +1 -1
- package/src/internal/grpc_layer/pdfium/image.js +8 -5
- package/src/internal/grpc_layer/pdfium/image.js.map +1 -1
- package/src/internal/grpc_layer/pdfium/image.ts +9 -8
- package/src/internal/grpc_layer/pdfium/io.d.ts +5 -5
- package/src/internal/grpc_layer/pdfium/io.d.ts.map +1 -1
- package/src/internal/grpc_layer/pdfium/io.js +6 -5
- package/src/internal/grpc_layer/pdfium/io.js.map +1 -1
- package/src/internal/grpc_layer/pdfium/io.ts +5 -5
- package/src/internal/grpc_layer/pdfium/page.d.ts.map +1 -1
- package/src/internal/grpc_layer/pdfium/page.js +27 -21
- package/src/internal/grpc_layer/pdfium/page.js.map +1 -1
- package/src/internal/grpc_layer/pdfium/page.ts +32 -27
- package/src/internal/grpc_layer/pdfium/pdfa.d.ts.map +1 -1
- package/src/internal/grpc_layer/pdfium/pdfa.js.map +1 -1
- package/src/internal/grpc_layer/pdfium/pdfa.ts +0 -2
- package/src/internal/grpc_layer/pdfium/security.d.ts.map +1 -1
- package/src/internal/grpc_layer/pdfium/security.js +9 -6
- package/src/internal/grpc_layer/pdfium/security.js.map +1 -1
- package/src/internal/grpc_layer/pdfium/security.ts +6 -7
- package/src/internal/grpc_layer/pdfium/signing.js +15 -15
- package/src/internal/grpc_layer/pdfium/signing.js.map +1 -1
- package/src/internal/grpc_layer/pdfium/signing.ts +4 -4
- package/src/internal/grpc_layer/pdfium/text.d.ts.map +1 -1
- package/src/internal/grpc_layer/pdfium/text.js.map +1 -1
- package/src/internal/grpc_layer/pdfium/text.ts +0 -2
- package/src/internal/grpc_layer/util.d.ts +6 -6
- package/src/internal/grpc_layer/util.d.ts.map +1 -1
- package/src/internal/grpc_layer/util.js +25 -14
- package/src/internal/grpc_layer/util.js.map +1 -1
- package/src/internal/grpc_layer/util.ts +35 -17
- package/src/internal/zod/ironpdfglobalconfigSchema.d.ts.map +1 -1
- package/src/internal/zod/ironpdfglobalconfigSchema.ts +1 -1
- package/src/internal/zod/stampSchema.d.ts +6 -6
- package/src/public/affix.d.ts +11 -11
- package/src/public/affix.d.ts.map +1 -1
- package/src/public/affix.ts +12 -12
- package/src/public/ironpdfglobalconfig.d.ts +9 -9
- package/src/public/ironpdfglobalconfig.d.ts.map +1 -1
- package/src/public/ironpdfglobalconfig.ts +9 -9
- package/src/public/pdfDocument.d.ts +52 -52
- package/src/public/pdfDocument.d.ts.map +1 -1
- package/src/public/pdfDocument.js +21 -17
- package/src/public/pdfDocument.js.map +1 -1
- package/src/public/pdfDocument.ts +134 -138
- package/src/public/pdfGenerator.d.ts +1 -1
- package/src/public/pdfGenerator.d.ts.map +1 -1
- package/src/public/pdfGenerator.ts +1 -1
- package/src/public/render.d.ts +33 -33
- package/src/public/render.d.ts.map +1 -1
- package/src/public/render.ts +37 -37
- package/src/public/security.d.ts +10 -10
- package/src/public/security.d.ts.map +1 -1
- package/src/public/security.ts +10 -10
- package/src/public/signature.d.ts +12 -12
- package/src/public/signature.d.ts.map +1 -1
- package/src/public/signature.ts +12 -12
- package/src/public/stamp.d.ts +26 -26
- package/src/public/stamp.d.ts.map +1 -1
- package/src/public/stamp.ts +27 -27
- package/src/public/types.d.ts +15 -15
- package/src/public/types.d.ts.map +1 -1
- package/src/public/types.ts +14 -14
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
Length,
|
|
14
14
|
MeasurementUnit,
|
|
15
15
|
PageInfo,
|
|
16
|
-
PdfPaperSize,
|
|
17
16
|
PaperSizeUnit,
|
|
18
17
|
PdfPageSelection,
|
|
19
18
|
PdfPaperOrientation,
|
|
19
|
+
PdfPaperSize,
|
|
20
20
|
PdfPassword,
|
|
21
21
|
TextStampOptions,
|
|
22
22
|
UseMargins,
|
|
@@ -37,11 +37,7 @@ import {FontTypeP} from "../../generated_proto/ironpdfengineproto/FontTypeP";
|
|
|
37
37
|
import {ChromeHttpLoginCredentialsP} from "../../generated_proto/ironpdfengineproto/ChromeHttpLoginCredentialsP";
|
|
38
38
|
import {PaperSize} from "../../../public/paper";
|
|
39
39
|
import {HtmlAffix, TextAffix} from "../../../public/affix";
|
|
40
|
-
import {
|
|
41
|
-
ChromePdfRenderOptions,
|
|
42
|
-
defaultChromePdfRenderOptions,
|
|
43
|
-
HttpLoginCredentials,
|
|
44
|
-
} from "../../../public/render";
|
|
40
|
+
import {ChromePdfRenderOptions, defaultChromePdfRenderOptions, HttpLoginCredentials,} from "../../../public/render";
|
|
45
41
|
import {ChromeImageBehaviorP} from "../../generated_proto/ironpdfengineproto/ChromeImageBehaviorP";
|
|
46
42
|
import {PageRotationToProto} from "../pdfium/converter";
|
|
47
43
|
import {
|
|
@@ -52,34 +48,31 @@ import {MeasurementUnitP} from "../../generated_proto/ironpdfengineproto/Measure
|
|
|
52
48
|
import {ChromeBarcodeEncodingP} from "../../generated_proto/ironpdfengineproto/ChromeBarcodeEncodingP";
|
|
53
49
|
import {VerticalAlignmentP} from "../../generated_proto/ironpdfengineproto/VerticalAlignmentP";
|
|
54
50
|
import {HorizontalAlignmentP} from "../../generated_proto/ironpdfengineproto/HorizontalAlignmentP";
|
|
55
|
-
import {PdfPageSelectionToIndexes} from "../util";
|
|
51
|
+
import {isNullOrUndefined, PdfPageSelectionToIndexes} from "../util";
|
|
56
52
|
import {PdfiumPageP} from "../../generated_proto/ironpdfengineproto/PdfiumPageP";
|
|
57
53
|
|
|
58
54
|
export function fitToPaperModeToProto(
|
|
59
|
-
fitToPaperMode
|
|
60
|
-
): ChromeFitToPaperModesP
|
|
61
|
-
if (!fitToPaperMode) return undefined;
|
|
55
|
+
fitToPaperMode: FitToPaperModes
|
|
56
|
+
): ChromeFitToPaperModesP{
|
|
62
57
|
return {enumValue: fitToPaperMode};
|
|
63
58
|
}
|
|
64
59
|
|
|
65
60
|
export function PdfPaperOrientationToProto(
|
|
66
|
-
pdfPaperOrientation
|
|
67
|
-
): ChromePdfPaperOrientationP
|
|
68
|
-
if (!pdfPaperOrientation) return undefined;
|
|
61
|
+
pdfPaperOrientation: PdfPaperOrientation
|
|
62
|
+
): ChromePdfPaperOrientationP {
|
|
69
63
|
return {enumValue: pdfPaperOrientation};
|
|
70
64
|
}
|
|
71
65
|
|
|
72
66
|
export function CssMediaTypeToProto(
|
|
73
|
-
cssMediaType
|
|
74
|
-
): ChromePdfCssMediaTypeP
|
|
75
|
-
if (!cssMediaType) return undefined;
|
|
67
|
+
cssMediaType: CssMediaType
|
|
68
|
+
): ChromePdfCssMediaTypeP {
|
|
76
69
|
return {enumValue: cssMediaType};
|
|
77
70
|
}
|
|
78
71
|
|
|
79
72
|
export function httpLoginCredentialsToProto(
|
|
80
|
-
httpLoginCredentials?: HttpLoginCredentials
|
|
81
|
-
): ChromeHttpLoginCredentialsP |
|
|
82
|
-
if (!httpLoginCredentials) return
|
|
73
|
+
httpLoginCredentials?: HttpLoginCredentials | undefined
|
|
74
|
+
): ChromeHttpLoginCredentialsP | null {
|
|
75
|
+
if (!httpLoginCredentials) return null;
|
|
83
76
|
throw new Error("not implement");
|
|
84
77
|
}
|
|
85
78
|
|
|
@@ -180,30 +173,29 @@ export function convertWaitFor(waitFor: WaitFor | undefined): WaitForDetail {
|
|
|
180
173
|
}
|
|
181
174
|
|
|
182
175
|
export function chromePdfRenderOptionsToProto(
|
|
183
|
-
renderOption?: ChromePdfRenderOptions
|
|
176
|
+
renderOption?: ChromePdfRenderOptions | undefined
|
|
184
177
|
): ChromePdfRenderOptionsP {
|
|
185
178
|
if (!renderOption) renderOption = defaultChromePdfRenderOptions();
|
|
186
179
|
|
|
187
180
|
const waitForDetail: WaitForDetail = convertWaitFor(renderOption.waitFor);
|
|
188
181
|
|
|
189
182
|
const proto: ChromePdfRenderOptionsP = {
|
|
190
|
-
createPdfFormsFromHtml: renderOption.createPdfFormsFromHtml,
|
|
191
|
-
customCssUrl: renderOption.customCssUrl,
|
|
192
|
-
enableJavaScript: renderOption.enableJavaScript,
|
|
193
|
-
fitToPaperMode: fitToPaperModeToProto(renderOption.fitToPaperMode),
|
|
194
|
-
grayScale: renderOption.grayScale,
|
|
195
|
-
|
|
196
|
-
marginTop: renderOption.margin?.top || renderOption.margin?.default,
|
|
197
|
-
marginBottom:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
marginRight: renderOption.margin?.right || renderOption.margin?.default,
|
|
183
|
+
createPdfFormsFromHtml: renderOption.createPdfFormsFromHtml ?? true,
|
|
184
|
+
customCssUrl: renderOption.customCssUrl ?? "",
|
|
185
|
+
enableJavaScript: renderOption.enableJavaScript ?? true,
|
|
186
|
+
fitToPaperMode: fitToPaperModeToProto(renderOption.fitToPaperMode ?? FitToPaperModes.Default),
|
|
187
|
+
grayScale: renderOption.grayScale ?? false,
|
|
188
|
+
|
|
189
|
+
marginTop: (renderOption.margin?.top || renderOption.margin?.default) ?? 25,
|
|
190
|
+
marginBottom: (renderOption.margin?.bottom || renderOption.margin?.default) ?? 25,
|
|
191
|
+
marginLeft: (renderOption.margin?.left || renderOption.margin?.default) ?? 25,
|
|
192
|
+
marginRight: (renderOption.margin?.right || renderOption.margin?.default) ?? 25,
|
|
201
193
|
|
|
202
194
|
paperOrientation: PdfPaperOrientationToProto(
|
|
203
|
-
renderOption.paperOrientation
|
|
195
|
+
renderOption.paperOrientation ?? PdfPaperOrientation.Portrait
|
|
204
196
|
),
|
|
205
197
|
|
|
206
|
-
printHtmlBackgrounds: renderOption.printHtmlBackgrounds,
|
|
198
|
+
printHtmlBackgrounds: renderOption.printHtmlBackgrounds ?? true,
|
|
207
199
|
|
|
208
200
|
timeout: renderOption.timeout ?? 60,
|
|
209
201
|
waitFor: {
|
|
@@ -219,37 +211,47 @@ export function chromePdfRenderOptionsToProto(
|
|
|
219
211
|
// WaitForNumAllowedInflight: waitForDetail.numAllowedInFlight,
|
|
220
212
|
// WaitForTimeout: waitForDetail.timeout,
|
|
221
213
|
|
|
222
|
-
title: renderOption.title,
|
|
214
|
+
title: renderOption.title ?? "",
|
|
223
215
|
viewPortHeight: 1280,
|
|
224
216
|
viewPortWidth: 1024,
|
|
225
217
|
zoom: 100,
|
|
226
|
-
inputEncoding: renderOption.inputEncoding,
|
|
227
|
-
cssMediaType: CssMediaTypeToProto(renderOption.cssMediaType),
|
|
228
|
-
javascript: renderOption.javascript,
|
|
229
|
-
firstPageNumber: renderOption.firstPageNumber,
|
|
230
218
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
219
|
+
|
|
220
|
+
javascript: renderOption.javascript ?? "",
|
|
221
|
+
firstPageNumber: renderOption.firstPageNumber ?? 1,
|
|
234
222
|
};
|
|
235
223
|
|
|
236
|
-
if
|
|
224
|
+
if(!isNullOrUndefined(renderOption.cssMediaType)){
|
|
225
|
+
proto.cssMediaType = CssMediaTypeToProto(renderOption.cssMediaType);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if(!isNullOrUndefined(renderOption.inputEncoding)){
|
|
229
|
+
proto.inputEncoding = renderOption.inputEncoding;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if(!isNullOrUndefined(renderOption.useMarginsOnHeaderAndFooter)){
|
|
233
|
+
proto.useMarginsOnHeaderFooter = useMarginsToProto(
|
|
234
|
+
renderOption.useMarginsOnHeaderAndFooter
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if (!isNullOrUndefined(renderOption.htmlHeader)) {
|
|
237
239
|
proto.htmlHeader = htmlAffixToProto(renderOption.htmlHeader);
|
|
238
240
|
}
|
|
239
241
|
|
|
240
|
-
if (renderOption.htmlFooter) {
|
|
242
|
+
if (!isNullOrUndefined(renderOption.htmlFooter)) {
|
|
241
243
|
proto.htmlFooter = htmlAffixToProto(renderOption.htmlFooter);
|
|
242
244
|
}
|
|
243
245
|
|
|
244
|
-
if (renderOption.textHeader) {
|
|
246
|
+
if (!isNullOrUndefined(renderOption.textHeader)) {
|
|
245
247
|
proto.textHeader = textAffixToProto(renderOption.textHeader);
|
|
246
248
|
}
|
|
247
249
|
|
|
248
|
-
if (renderOption.textFooter) {
|
|
250
|
+
if (!isNullOrUndefined(renderOption.textFooter)) {
|
|
249
251
|
proto.textFooter = textAffixToProto(renderOption.textFooter);
|
|
250
252
|
}
|
|
251
253
|
|
|
252
|
-
if (renderOption.paperSize) {
|
|
254
|
+
if (!isNullOrUndefined(renderOption.paperSize)) {
|
|
253
255
|
if (pdfPaperSizeIsCustom(renderOption.paperSize)) {
|
|
254
256
|
const wh = customPaperSizeToMm(
|
|
255
257
|
renderOption.paperSize as CustomPaperSize
|
|
@@ -268,22 +270,15 @@ export function chromePdfRenderOptionsToProto(
|
|
|
268
270
|
}
|
|
269
271
|
|
|
270
272
|
export function pdfPaperSizeIsCustom(pdfPaperSize: PdfPaperSize) {
|
|
271
|
-
|
|
272
|
-
pdfPaperSize instanceof Object &&
|
|
273
|
+
return pdfPaperSize instanceof Object &&
|
|
273
274
|
"width" in pdfPaperSize &&
|
|
274
275
|
"height" in pdfPaperSize &&
|
|
275
|
-
"unit" in pdfPaperSize
|
|
276
|
-
) {
|
|
277
|
-
return true;
|
|
278
|
-
} else {
|
|
279
|
-
return false;
|
|
280
|
-
}
|
|
276
|
+
"unit" in pdfPaperSize;
|
|
281
277
|
}
|
|
282
278
|
|
|
283
279
|
export function htmlAffixToProto(
|
|
284
|
-
htmlAffix
|
|
285
|
-
): ChromeHtmlHeaderFooterP
|
|
286
|
-
if (!htmlAffix) return undefined;
|
|
280
|
+
htmlAffix: HtmlAffix
|
|
281
|
+
): ChromeHtmlHeaderFooterP {
|
|
287
282
|
return {
|
|
288
283
|
htmlFragment: htmlAffix.htmlFragment ?? "",
|
|
289
284
|
// baseUrl: htmlAffix.baseUrl, //not supported
|
|
@@ -297,13 +292,12 @@ export function htmlAffixToProto(
|
|
|
297
292
|
|
|
298
293
|
export function textAffixToProto(
|
|
299
294
|
textAffix: TextAffix
|
|
300
|
-
): ChromeTextHeaderFooterP
|
|
301
|
-
if (!textAffix) return undefined;
|
|
295
|
+
): ChromeTextHeaderFooterP {
|
|
302
296
|
return {
|
|
303
|
-
leftText: textAffix
|
|
304
|
-
rightText: textAffix
|
|
305
|
-
centerText: textAffix
|
|
306
|
-
font: fontToProto(textAffix.font),
|
|
297
|
+
leftText: textAffix?.leftText ?? "",
|
|
298
|
+
rightText: textAffix?.rightText ?? "",
|
|
299
|
+
centerText: textAffix?.centerText ?? "",
|
|
300
|
+
font: fontToProto(textAffix.font) ?? null,
|
|
307
301
|
fontSize: textAffix.fontSize ?? 12,
|
|
308
302
|
dividerLineColor: textAffix.dividerLineColor ?? "#B1B1B1",
|
|
309
303
|
drawDividerLine: textAffix.dividerLine ?? false,
|
|
@@ -311,20 +305,19 @@ export function textAffixToProto(
|
|
|
311
305
|
}
|
|
312
306
|
|
|
313
307
|
export function fontToProto(affixFonts?: AffixFonts): FontTypeP | undefined {
|
|
314
|
-
if (!affixFonts) return {name: AffixFonts[AffixFonts.Arial]
|
|
315
|
-
return {name: AffixFonts[affixFonts]
|
|
308
|
+
if (!affixFonts) return {name: AffixFonts[AffixFonts.Arial]?.replace("_","-") ?? ""};
|
|
309
|
+
return {name: AffixFonts[affixFonts]?.replace("_","-") ?? ""};
|
|
316
310
|
}
|
|
317
311
|
|
|
318
312
|
export function useMarginsToProto(
|
|
319
|
-
useMargins
|
|
320
|
-
): ChromeUseMarginsP
|
|
313
|
+
useMargins: UseMargins
|
|
314
|
+
): ChromeUseMarginsP {
|
|
321
315
|
return {enumValue: useMargins};
|
|
322
316
|
}
|
|
323
317
|
|
|
324
318
|
export function paperSizeToProto(
|
|
325
|
-
paperSize
|
|
326
|
-
): ChromePdfPaperSizeP
|
|
327
|
-
if (!paperSize) return undefined;
|
|
319
|
+
paperSize: PaperSize
|
|
320
|
+
): ChromePdfPaperSizeP{
|
|
328
321
|
return {enumValue: paperSize};
|
|
329
322
|
}
|
|
330
323
|
|
|
@@ -546,20 +539,18 @@ function toMillimeters(paperSize: PaperSize): WidthHeight {
|
|
|
546
539
|
}
|
|
547
540
|
|
|
548
541
|
export function pdfPaperSizeToProto(
|
|
549
|
-
pdfPaperSize?: PdfPaperSize
|
|
550
|
-
): { paperSizeP: ChromePdfPaperSizeP; widthHeight?: WidthHeight } | undefined {
|
|
542
|
+
pdfPaperSize?: PdfPaperSize | undefined
|
|
543
|
+
): { paperSizeP: ChromePdfPaperSizeP; widthHeight?: WidthHeight | undefined } | undefined {
|
|
551
544
|
if (!pdfPaperSize) return undefined;
|
|
552
545
|
|
|
553
|
-
if (typeof pdfPaperSize === "object") {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
};
|
|
562
|
-
}
|
|
546
|
+
if (typeof pdfPaperSize === "object" && "width" in pdfPaperSize) {
|
|
547
|
+
return {
|
|
548
|
+
paperSizeP: { enumValue: 106 },
|
|
549
|
+
widthHeight: {
|
|
550
|
+
width: pdfPaperSize.width,
|
|
551
|
+
height: pdfPaperSize.height,
|
|
552
|
+
},
|
|
553
|
+
};
|
|
563
554
|
} else {
|
|
564
555
|
const wh = toMillimeters(pdfPaperSize);
|
|
565
556
|
return {
|
|
@@ -570,9 +561,9 @@ export function pdfPaperSizeToProto(
|
|
|
570
561
|
}
|
|
571
562
|
|
|
572
563
|
export function imageBehaviorToProto(
|
|
573
|
-
imageBehavior?: ImageBehavior
|
|
574
|
-
): ChromeImageBehaviorP |
|
|
575
|
-
if (!imageBehavior) return
|
|
564
|
+
imageBehavior?: ImageBehavior | undefined
|
|
565
|
+
): ChromeImageBehaviorP | null {
|
|
566
|
+
if (!imageBehavior) return null;
|
|
576
567
|
return {enumValue: imageBehavior};
|
|
577
568
|
}
|
|
578
569
|
|
|
@@ -609,34 +600,39 @@ function BaseStampOptionsToProto(
|
|
|
609
600
|
id: string,
|
|
610
601
|
pagesInfo: PageInfo[],
|
|
611
602
|
defaultRenderDelay: number,
|
|
612
|
-
password?: PdfPassword,
|
|
613
|
-
options?: BaseStampOptions,
|
|
614
|
-
pageSelection?: PdfPageSelection
|
|
603
|
+
password?: PdfPassword | undefined,
|
|
604
|
+
options?: BaseStampOptions | undefined,
|
|
605
|
+
pageSelection?: PdfPageSelection | undefined
|
|
615
606
|
): _ironpdfengineproto_ChromeApplyStampRequestStreamP_InfoP {
|
|
616
607
|
const pi =
|
|
617
|
-
PdfPageSelectionToIndexes(
|
|
608
|
+
PdfPageSelectionToIndexes(pagesInfo, pageSelection) ??
|
|
618
609
|
Array.from({
|
|
619
610
|
length: pagesInfo.length,
|
|
620
|
-
}).map((
|
|
621
|
-
const
|
|
611
|
+
}).map((_, index) => index);
|
|
612
|
+
const pages: PdfiumPageP[] = pi.map((pageIndex) => {
|
|
622
613
|
// if (pagesInfo) {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
height: pagesInfo[pageIndex].millimeterHeight,
|
|
626
|
-
pageIndex: pageIndex,
|
|
627
|
-
pageRotation: PageRotationToProto(
|
|
628
|
-
pagesInfo[pageIndex].pageRotation
|
|
629
|
-
),
|
|
630
|
-
printWidth: pagesInfo[pageIndex].printerPointWidth,
|
|
631
|
-
printHeight: pagesInfo[pageIndex].printerPointHeight,
|
|
614
|
+
const pageP: PdfiumPageP = {
|
|
615
|
+
pageIndex: pageIndex
|
|
632
616
|
};
|
|
617
|
+
|
|
618
|
+
const pageInfo = pagesInfo[pageIndex];
|
|
619
|
+
if(!isNullOrUndefined(pageInfo)){
|
|
620
|
+
pageP.width = pageInfo.millimeterWidth;
|
|
621
|
+
pageP.height = pageInfo.millimeterHeight;
|
|
622
|
+
pageP.pageRotation = PageRotationToProto(
|
|
623
|
+
pageInfo.pageRotation
|
|
624
|
+
);
|
|
625
|
+
pageP.printWidth = pageInfo.printerPointWidth;
|
|
626
|
+
pageP.printHeight = pageInfo.printerPointHeight;
|
|
627
|
+
}
|
|
628
|
+
return pageP;
|
|
633
629
|
// }
|
|
634
630
|
// return { pageIndex: pageIndex };
|
|
635
631
|
});
|
|
636
632
|
|
|
637
633
|
return {
|
|
638
634
|
document: {documentId: id},
|
|
639
|
-
hyperlink: options?.hyperlink,
|
|
635
|
+
hyperlink: options?.hyperlink ?? "",
|
|
640
636
|
horizontalAlignment: horizontalAlignmentToProto(
|
|
641
637
|
options?.horizontalAlignment
|
|
642
638
|
),
|
|
@@ -644,12 +640,12 @@ function BaseStampOptionsToProto(
|
|
|
644
640
|
horizontalOffset: lengthToProto(options?.horizontalOffset),
|
|
645
641
|
verticalOffset: lengthToProto(options?.verticalOffset),
|
|
646
642
|
isStampBehindContent: options?.behindExistingContent ?? false,
|
|
647
|
-
opacity: options?.opacity,
|
|
648
|
-
rotation: options?.rotation,
|
|
649
|
-
scale: options?.scale,
|
|
650
|
-
targetPages:
|
|
651
|
-
ownerPassword: password?.ownerPassword,
|
|
652
|
-
userPassword: password?.userPassword,
|
|
643
|
+
opacity: options?.opacity ?? 100,
|
|
644
|
+
rotation: options?.rotation ?? 0,
|
|
645
|
+
scale: options?.scale ?? 100,
|
|
646
|
+
targetPages: pages ?? [],
|
|
647
|
+
ownerPassword: password?.ownerPassword ?? "",
|
|
648
|
+
userPassword: password?.userPassword ?? "",
|
|
653
649
|
renderDelay: options?.renderDelay ?? defaultRenderDelay,
|
|
654
650
|
timeout: options?.timeout ?? 60,
|
|
655
651
|
maxHeight: lengthToProto(options?.maxHeight),
|
|
@@ -662,9 +658,9 @@ function BaseStampOptionsToProto(
|
|
|
662
658
|
export function HtmlStampOptionsToProto(
|
|
663
659
|
id: string,
|
|
664
660
|
pagesInfo: PageInfo[],
|
|
665
|
-
password?: PdfPassword,
|
|
666
|
-
options?: HtmlStampOptions,
|
|
667
|
-
pageSelection?: PdfPageSelection
|
|
661
|
+
password?: PdfPassword | undefined,
|
|
662
|
+
options?: HtmlStampOptions | undefined,
|
|
663
|
+
pageSelection?: PdfPageSelection | undefined
|
|
668
664
|
): _ironpdfengineproto_ChromeApplyStampRequestStreamP_InfoP {
|
|
669
665
|
const base = BaseStampOptionsToProto(
|
|
670
666
|
id,
|
|
@@ -684,9 +680,9 @@ export function HtmlStampOptionsToProto(
|
|
|
684
680
|
export function TextStampOptionsToProto(
|
|
685
681
|
id: string,
|
|
686
682
|
pagesInfo: PageInfo[],
|
|
687
|
-
password?: PdfPassword,
|
|
688
|
-
options?: TextStampOptions,
|
|
689
|
-
pageSelection?: PdfPageSelection
|
|
683
|
+
password?: PdfPassword | undefined,
|
|
684
|
+
options?: TextStampOptions | undefined,
|
|
685
|
+
pageSelection?: PdfPageSelection | undefined
|
|
690
686
|
): _ironpdfengineproto_ChromeApplyStampRequestStreamP_InfoP {
|
|
691
687
|
const base = BaseStampOptionsToProto(
|
|
692
688
|
id,
|
|
@@ -697,15 +693,15 @@ export function TextStampOptionsToProto(
|
|
|
697
693
|
pageSelection
|
|
698
694
|
);
|
|
699
695
|
base.textStamper = {
|
|
700
|
-
textColor: options?.textColor,
|
|
701
|
-
fontSize: options?.fontSize,
|
|
702
|
-
backgroundColor: options?.backgroundColor,
|
|
703
|
-
fontFamily: options?.fontFamily,
|
|
704
|
-
isBold: options?.isBold,
|
|
705
|
-
isItalic: options?.isItalic,
|
|
706
|
-
isStrikethrough: options?.isStrikethrough,
|
|
707
|
-
isUnderline: options?.isUnderline,
|
|
708
|
-
useGoogleFont: options?.useGoogleFont,
|
|
696
|
+
textColor: options?.textColor ?? "#000000",
|
|
697
|
+
fontSize: options?.fontSize ?? 12,
|
|
698
|
+
backgroundColor: options?.backgroundColor ?? "#00FFFFFF",
|
|
699
|
+
fontFamily: options?.fontFamily ?? "Arial",
|
|
700
|
+
isBold: options?.isBold ?? false,
|
|
701
|
+
isItalic: options?.isItalic ?? false,
|
|
702
|
+
isStrikethrough: options?.isStrikethrough ?? false,
|
|
703
|
+
isUnderline: options?.isUnderline ?? false,
|
|
704
|
+
useGoogleFont: options?.useGoogleFont ?? false,
|
|
709
705
|
};
|
|
710
706
|
return base;
|
|
711
707
|
}
|
|
@@ -713,9 +709,9 @@ export function TextStampOptionsToProto(
|
|
|
713
709
|
export function ImageStampOptionsToProto(
|
|
714
710
|
id: string,
|
|
715
711
|
pagesInfo: PageInfo[],
|
|
716
|
-
password?: PdfPassword,
|
|
717
|
-
options?: ImageStampOptions,
|
|
718
|
-
pageSelection?: PdfPageSelection
|
|
712
|
+
password?: PdfPassword | undefined,
|
|
713
|
+
options?: ImageStampOptions | undefined,
|
|
714
|
+
pageSelection?: PdfPageSelection | undefined
|
|
719
715
|
): _ironpdfengineproto_ChromeApplyStampRequestStreamP_InfoP {
|
|
720
716
|
const base = BaseStampOptionsToProto(
|
|
721
717
|
id,
|
|
@@ -732,9 +728,9 @@ export function ImageStampOptionsToProto(
|
|
|
732
728
|
export function BarcodeStampOptionsToProto(
|
|
733
729
|
id: string,
|
|
734
730
|
pagesInfo: PageInfo[],
|
|
735
|
-
password?: PdfPassword,
|
|
736
|
-
options?: BarcodeStampOptions,
|
|
737
|
-
pageSelection?: PdfPageSelection
|
|
731
|
+
password?: PdfPassword | undefined,
|
|
732
|
+
options?: BarcodeStampOptions | undefined,
|
|
733
|
+
pageSelection?: PdfPageSelection | undefined
|
|
738
734
|
): _ironpdfengineproto_ChromeApplyStampRequestStreamP_InfoP {
|
|
739
735
|
const base = BaseStampOptionsToProto(
|
|
740
736
|
id,
|
|
@@ -754,8 +750,8 @@ export function BarcodeStampOptionsToProto(
|
|
|
754
750
|
return base;
|
|
755
751
|
}
|
|
756
752
|
|
|
757
|
-
export function lengthToProto(length?: Length): LengthP |
|
|
758
|
-
if (!length) return
|
|
753
|
+
export function lengthToProto(length?: Length): LengthP | null {
|
|
754
|
+
if (!length) return null;
|
|
759
755
|
return {
|
|
760
756
|
value: length.value,
|
|
761
757
|
unit: measurementUnitToProto(length.unit),
|
|
@@ -763,45 +759,44 @@ export function lengthToProto(length?: Length): LengthP | undefined {
|
|
|
763
759
|
}
|
|
764
760
|
|
|
765
761
|
export function measurementUnitToProto(
|
|
766
|
-
measurementUnit
|
|
767
|
-
): MeasurementUnitP
|
|
768
|
-
if (!measurementUnit) return undefined;
|
|
762
|
+
measurementUnit: MeasurementUnit
|
|
763
|
+
): MeasurementUnitP {
|
|
769
764
|
return {
|
|
770
765
|
enumValue: measurementUnit,
|
|
771
766
|
};
|
|
772
767
|
}
|
|
773
768
|
|
|
774
769
|
export function horizontalAlignmentToProto(
|
|
775
|
-
horizontalAlignment?: HorizontalAlignment
|
|
776
|
-
): HorizontalAlignmentP |
|
|
777
|
-
if (!horizontalAlignment) return
|
|
770
|
+
horizontalAlignment?: HorizontalAlignment | undefined
|
|
771
|
+
): HorizontalAlignmentP | null {
|
|
772
|
+
if (!horizontalAlignment) return null;
|
|
778
773
|
return {
|
|
779
774
|
enumValue: horizontalAlignment,
|
|
780
775
|
};
|
|
781
776
|
}
|
|
782
777
|
|
|
783
778
|
export function verticalAlignmentToProto(
|
|
784
|
-
verticalAlignment?: VerticalAlignment
|
|
785
|
-
): VerticalAlignmentP |
|
|
786
|
-
if (!verticalAlignment) return
|
|
779
|
+
verticalAlignment?: VerticalAlignment | undefined
|
|
780
|
+
): VerticalAlignmentP | null {
|
|
781
|
+
if (!verticalAlignment) return null;
|
|
787
782
|
return {
|
|
788
783
|
enumValue: verticalAlignment,
|
|
789
784
|
};
|
|
790
785
|
}
|
|
791
786
|
|
|
792
787
|
export function cssMediaTypeToProto(
|
|
793
|
-
cssMediaType?: CssMediaType
|
|
794
|
-
): ChromePdfCssMediaTypeP |
|
|
795
|
-
if (!cssMediaType) return
|
|
788
|
+
cssMediaType?: CssMediaType | undefined
|
|
789
|
+
): ChromePdfCssMediaTypeP | null {
|
|
790
|
+
if (!cssMediaType) return null;
|
|
796
791
|
return {
|
|
797
792
|
enumValue: cssMediaType,
|
|
798
793
|
};
|
|
799
794
|
}
|
|
800
795
|
|
|
801
796
|
export function barcodeTypeToProto(
|
|
802
|
-
barcodeType?: BarcodeType
|
|
803
|
-
): ChromeBarcodeEncodingP |
|
|
804
|
-
if (!barcodeType) return
|
|
797
|
+
barcodeType?: BarcodeType | undefined
|
|
798
|
+
): ChromeBarcodeEncodingP | null {
|
|
799
|
+
if (!barcodeType) return null;
|
|
805
800
|
return {
|
|
806
801
|
enumValue: barcodeType,
|
|
807
802
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ChromePdfRenderOptions, HttpLoginCredentials } from "../../../public/render";
|
|
2
|
-
export declare function renderHtmlZipToPdf(zipFilePath: string, mainHtmlFile?: string, renderOption?: ChromePdfRenderOptions, httpLoginCredentials?: HttpLoginCredentials): Promise<string>;
|
|
2
|
+
export declare function renderHtmlZipToPdf(zipFilePath: string, mainHtmlFile?: string, renderOption?: ChromePdfRenderOptions | undefined, httpLoginCredentials?: HttpLoginCredentials | undefined): Promise<string>;
|
|
3
3
|
export declare function renderUrlToPdf(url: URL, options?: {
|
|
4
|
-
renderOptions?: ChromePdfRenderOptions;
|
|
5
|
-
httpLoginCredentials?: HttpLoginCredentials;
|
|
6
|
-
}): Promise<string>;
|
|
7
|
-
export declare function renderHtmlToPdf(html: string, renderOption?: ChromePdfRenderOptions, httpLoginCredentials?: HttpLoginCredentials): Promise<string>;
|
|
4
|
+
renderOptions?: ChromePdfRenderOptions | undefined;
|
|
5
|
+
httpLoginCredentials?: HttpLoginCredentials | undefined;
|
|
6
|
+
} | undefined): Promise<string>;
|
|
7
|
+
export declare function renderHtmlToPdf(html: string, renderOption?: ChromePdfRenderOptions | undefined, httpLoginCredentials?: HttpLoginCredentials | undefined): Promise<string>;
|
|
8
8
|
export declare function mergePdfs(pdfIds: string[]): Promise<string>;
|
|
9
9
|
//# sourceMappingURL=render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["render.ts"],"names":[],"mappings":"AAIA,OAAO,EACN,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAoBhC,wBAAsB,kBAAkB,CACvC,WAAW,EAAE,MAAM,EACnB,YAAY,SAAe,EAC3B,YAAY,CAAC,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["render.ts"],"names":[],"mappings":"AAIA,OAAO,EACN,sBAAsB,EACtB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAoBhC,wBAAsB,kBAAkB,CACvC,WAAW,EAAE,MAAM,EACnB,YAAY,SAAe,EAC3B,YAAY,CAAC,EAAE,sBAAsB,GAAG,SAAS,EACjD,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,SAAS,GACrD,OAAO,CAAC,MAAM,CAAC,CAwCjB;AAED,wBAAsB,cAAc,CACnC,GAAG,EAAE,GAAG,EACR,OAAO,CAAC,EAAE;IACT,aAAa,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;IACnD,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CACxD,GAAG,SAAS,GACX,OAAO,CAAC,MAAM,CAAC,CAiCjB;AAED,wBAAsB,eAAe,CACpC,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,sBAAsB,GAAG,SAAS,EACjD,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,SAAS,GACrD,OAAO,CAAC,MAAM,CAAC,CAqCjB;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA2BjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["render.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,4CAAoB;AAMpB,yCAAsC;AAEtC,kCAIiB;AACjB,2CAGqB;AAQrB,SAAsB,kBAAkB,CACvC,WAAmB,EACnB,YAAY,GAAG,YAAY,EAC3B,
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["render.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,4CAAoB;AAMpB,yCAAsC;AAEtC,kCAIiB;AACjB,2CAGqB;AAQrB,SAAsB,kBAAkB,CACvC,WAAmB,EACnB,YAAY,GAAG,YAAY,EAC3B,YAAiD,EACjD,oBAAuD;;QAEvD,MAAM,MAAM,GAAyB,MAAM,eAAM,CAAC,gBAAgB,EAAE,CAAC;QACrE,OAAO,IAAI,OAAO,CACjB,CAAC,OAA4B,EAAE,MAAkC,EAAE,EAAE;YACpE,MAAM,MAAM,GAAG,MAAM,CAAC,uBAAuB,CAC5C,CACC,GAAwB,EACxB,KAA6C,EAC5C,EAAE;gBACH,IAAI,GAAG,EAAE;o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zB,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,GAAG,EAAE,CAAC;QACd,CAAC,CACD,CAAC;IACH,CAAC;CAAA;AAzCD,0CAyCC;AAED,SAAsB,SAAS,CAAC,MAAgB;;QAC/C,MAAM,MAAM,GAAyB,MAAM,eAAM,CAAC,gBAAgB,EAAE,CAAC;QACrE,OAAO,IAAI,OAAO,CACjB,CAAC,OAA4B,EAAE,MAAkC,EAAE,EAAE;YACpE,MAAM,CAAC,eAAe,CACrB;gBACC,SAAS,EAAE,MAAM,CAAC,GAAG,CACpB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAc,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA,CAC9C;aACD,EACD,CACC,GAAwB,EACxB,KAA6C,EAC5C,EAAE;gBACH,IAAI,GAAG,EAAE;oBACR,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;iBACtC;qBAAM,IAAI,KAAK,EAAE;oBACjB,IAAA,uCAAgC,EAC/B,KAAK,EACL,OAAO,EACP,MAAM,CACN,CAAC;iBACF;YACF,CAAC,CACD,CAAC;QACH,CAAC,CACD,CAAC;IACH,CAAC;CAAA;AA3BD,8BA2BC"}
|
|
@@ -28,8 +28,8 @@ import { PdfDocumentP } from "../../generated_proto/ironpdfengineproto/PdfDocume
|
|
|
28
28
|
export async function renderHtmlZipToPdf(
|
|
29
29
|
zipFilePath: string,
|
|
30
30
|
mainHtmlFile = "Basic.html",
|
|
31
|
-
renderOption?: ChromePdfRenderOptions,
|
|
32
|
-
httpLoginCredentials?: HttpLoginCredentials
|
|
31
|
+
renderOption?: ChromePdfRenderOptions | undefined,
|
|
32
|
+
httpLoginCredentials?: HttpLoginCredentials | undefined
|
|
33
33
|
): Promise<string> {
|
|
34
34
|
const client: IronPdfServiceClient = await Access.ensureConnection();
|
|
35
35
|
return new Promise(
|
|
@@ -75,9 +75,9 @@ export async function renderHtmlZipToPdf(
|
|
|
75
75
|
export async function renderUrlToPdf(
|
|
76
76
|
url: URL,
|
|
77
77
|
options?: {
|
|
78
|
-
renderOptions?: ChromePdfRenderOptions;
|
|
79
|
-
httpLoginCredentials?: HttpLoginCredentials;
|
|
80
|
-
}
|
|
78
|
+
renderOptions?: ChromePdfRenderOptions | undefined;
|
|
79
|
+
httpLoginCredentials?: HttpLoginCredentials | undefined;
|
|
80
|
+
} | undefined
|
|
81
81
|
): Promise<string> {
|
|
82
82
|
const client: IronPdfServiceClient = await Access.ensureConnection();
|
|
83
83
|
return new Promise(
|
|
@@ -115,8 +115,8 @@ export async function renderUrlToPdf(
|
|
|
115
115
|
|
|
116
116
|
export async function renderHtmlToPdf(
|
|
117
117
|
html: string,
|
|
118
|
-
renderOption?: ChromePdfRenderOptions,
|
|
119
|
-
httpLoginCredentials?: HttpLoginCredentials
|
|
118
|
+
renderOption?: ChromePdfRenderOptions | undefined,
|
|
119
|
+
httpLoginCredentials?: HttpLoginCredentials | undefined
|
|
120
120
|
): Promise<string> {
|
|
121
121
|
const client: IronPdfServiceClient = await Access.ensureConnection();
|
|
122
122
|
return new Promise(
|
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
import { BarcodeStampOptions, HtmlStampOptions, ImageStampOptions, TextStampOptions } from "../../../public/stamp";
|
|
4
4
|
import { PdfPageSelection, PdfPassword } from "../../../public/types";
|
|
5
5
|
export declare function stampHtml(id: string, html: string, options?: {
|
|
6
|
-
htmlStampOptions?: HtmlStampOptions;
|
|
7
|
-
pageSelection?: PdfPageSelection;
|
|
8
|
-
password?: PdfPassword;
|
|
9
|
-
}): Promise<void>;
|
|
6
|
+
htmlStampOptions?: HtmlStampOptions | undefined;
|
|
7
|
+
pageSelection?: PdfPageSelection | undefined;
|
|
8
|
+
password?: PdfPassword | undefined;
|
|
9
|
+
} | undefined): Promise<void>;
|
|
10
10
|
export declare function stampText(id: string, text: string, options?: {
|
|
11
|
-
password?: PdfPassword;
|
|
12
|
-
textStampOptions?: TextStampOptions;
|
|
13
|
-
pageSelection?: PdfPageSelection;
|
|
14
|
-
}): Promise<void>;
|
|
11
|
+
password?: PdfPassword | undefined;
|
|
12
|
+
textStampOptions?: TextStampOptions | undefined;
|
|
13
|
+
pageSelection?: PdfPageSelection | undefined;
|
|
14
|
+
} | undefined): Promise<void>;
|
|
15
15
|
export declare function stampImage(id: string, imageBuffer: Buffer, options?: {
|
|
16
|
-
password?: PdfPassword;
|
|
17
|
-
imageStampOptions?: ImageStampOptions;
|
|
18
|
-
pageSelection?: PdfPageSelection;
|
|
19
|
-
}): Promise<void>;
|
|
16
|
+
password?: PdfPassword | undefined;
|
|
17
|
+
imageStampOptions?: ImageStampOptions | undefined;
|
|
18
|
+
pageSelection?: PdfPageSelection | undefined;
|
|
19
|
+
} | undefined): Promise<void>;
|
|
20
20
|
export declare function stampBarcode(id: string, barcodeValue: string, options?: {
|
|
21
|
-
password?: PdfPassword;
|
|
22
|
-
barcodeStampOptions?: BarcodeStampOptions;
|
|
23
|
-
pageSelection?: PdfPageSelection;
|
|
24
|
-
}): Promise<void>;
|
|
21
|
+
password?: PdfPassword | undefined;
|
|
22
|
+
barcodeStampOptions?: BarcodeStampOptions | undefined;
|
|
23
|
+
pageSelection?: PdfPageSelection | undefined;
|
|
24
|
+
} | undefined): Promise<void>;
|
|
25
25
|
//# sourceMappingURL=stamp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stamp.d.ts","sourceRoot":"","sources":["stamp.ts"],"names":[],"mappings":";;AAMA,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AA2BtE,wBAAsB,SAAS,CAC9B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MA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EAAE,EAAE,MAAM,EACV,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE;IACT,QAAQ,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACnC,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IACtD,aAAa,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC7C,GAAG,SAAS,GACX,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stamp.js","sourceRoot":"","sources":["stamp.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,kCAA+E;AAQ/E,yCAAsC;AACtC,yCAA6C;AAC7C,2CAKqB;AAErB,SAAS,iBAAiB,CACzB,MAA4B,EAC5B,OAA0B,EAC1B,MAAkC;IAElC,OAAO,MAAM,CAAC,uBAAuB,CACpC,CAAC,GAAwB,EAAE,KAAuC,EAAE,EAAE;QACrE,IAAI,GAAG,EAAE;YACR,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;SACtC;aAAM,IAAI,KAAK,EAAE;YACjB,IAAA,iCAA0B,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAC1C,OAAO,EAAE,CAAC;SACV;IACF,CAAC,CACD,CAAC;AACH,CAAC;AAED,SAAsB,SAAS,CAC9B,EAAU,EACV,IAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"stamp.js","sourceRoot":"","sources":["stamp.ts"],"names":[],"mappings":";;;;;;;;;;;;AAKA,kCAA+E;AAQ/E,yCAAsC;AACtC,yCAA6C;AAC7C,2CAKqB;AAErB,SAAS,iBAAiB,CACzB,MAA4B,EAC5B,OAA0B,EAC1B,MAAkC;IAElC,OAAO,MAAM,CAAC,uBAAuB,CACpC,CAAC,GAAwB,EAAE,KAAuC,EAAE,EAAE;QACrE,IAAI,GAAG,EAAE;YACR,MAAM,CAAC,GAAG,GAAG,CAAC,IA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