Skip to content

Commit

Permalink
📦 Build 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vbuch committed Jan 11, 2024
1 parent 7948ce4 commit 95a4e6d
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 13 deletions.
6 changes: 5 additions & 1 deletion packages/placeholder-pdfkit/dist/pdfkitAddPlaceholder.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function pdfkitAddPlaceholder({ pdf, reason, contactInfo, name, location, signingTime, signatureLength, byteRangePlaceholder, subFilter, widgetRect, }: InputType): ReturnType;
export function pdfkitAddPlaceholder({ pdf, reason, contactInfo, name, location, signingTime, signatureLength, byteRangePlaceholder, subFilter, widgetRect, appName, }: InputType): ReturnType;
export type InputType = {
/**
* PDFDocument
Expand All @@ -20,6 +20,10 @@ export type InputType = {
* [x1, y1, x2, y2] widget rectangle
*/
widgetRect?: number[];
/**
* Name of the application generating the signature
*/
appName?: string;
};
export type ReturnType = {
signature: any;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions packages/placeholder-pdfkit/dist/pdfkitAddPlaceholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var _utils = require("@signpdf/utils");
* @property {string} [byteRangePlaceholder]
* @property {string} [subFilter] One of SUBFILTER_* from \@signpdf/utils
* @property {number[]} [widgetRect] [x1, y1, x2, y2] widget rectangle
* @property {string} [appName] Name of the application generating the signature
*/

/**
Expand All @@ -44,7 +45,8 @@ const pdfkitAddPlaceholder = ({
signatureLength = _utils.DEFAULT_SIGNATURE_LENGTH,
byteRangePlaceholder = _utils.DEFAULT_BYTE_RANGE_PLACEHOLDER,
subFilter = _utils.SUBFILTER_ADOBE_PKCS7_DETACHED,
widgetRect = [0, 0, 0, 0]
widgetRect = [0, 0, 0, 0],
appName = undefined
}) => {
/* eslint-disable no-underscore-dangle,no-param-reassign */
// Generate the signature placeholder
Expand All @@ -61,9 +63,19 @@ const pdfkitAddPlaceholder = ({
// eslint-disable-line no-new-wrappers
Name: new String(name),
// eslint-disable-line no-new-wrappers
Location: new String(location) // eslint-disable-line no-new-wrappers
Location: new String(location),
// eslint-disable-line no-new-wrappers
Prop_Build: {
Filter: {
Name: 'Adobe.PPKLite'
},
...(appName ? {
App: {
Name: appName
}
} : {})
}
});

if (!pdf._acroform) {
pdf.initForm();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function pdfkitAddPlaceholder({ pdf, pdfBuffer, reason, contactInfo, name, location, signingTime, signatureLength, byteRangePlaceholder, subFilter, widgetRect, }: InputType): ReturnType;
export function pdfkitAddPlaceholder({ pdf, pdfBuffer, reason, contactInfo, name, location, signingTime, signatureLength, byteRangePlaceholder, subFilter, widgetRect, appName, }: InputType): ReturnType;
export type InputType = {
/**
* PDFDocument
Expand All @@ -20,6 +20,10 @@ export type InputType = {
* [x1, y1, x2, y2] widget rectangle
*/
widgetRect?: number[];
/**
* Name of the application generating the signature
*/
appName?: string;
};
export type ReturnType = {
signature: any;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 15 additions & 2 deletions packages/placeholder-pdfkit010/dist/pdfkitAddPlaceholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var _pdfkitReferenceMock = require("./pdfkitReferenceMock");
* @property {string} [byteRangePlaceholder]
* @property {string} [subFilter] One of SUBFILTER_* from \@signpdf/utils
* @property {number[]} [widgetRect] [x1, y1, x2, y2] widget rectangle
* @property {string} [appName] Name of the application generating the signature
*/

/**
Expand Down Expand Up @@ -48,7 +49,8 @@ const pdfkitAddPlaceholder = ({
signatureLength = _utils.DEFAULT_SIGNATURE_LENGTH,
byteRangePlaceholder = _utils.DEFAULT_BYTE_RANGE_PLACEHOLDER,
subFilter = _utils.SUBFILTER_ADOBE_PKCS7_DETACHED,
widgetRect = [0, 0, 0, 0]
widgetRect = [0, 0, 0, 0],
appName = undefined
}) => {
/* eslint-disable no-underscore-dangle,no-param-reassign */
// Generate the signature placeholder
Expand All @@ -65,7 +67,18 @@ const pdfkitAddPlaceholder = ({
// eslint-disable-line no-new-wrappers
Name: new String(name),
// eslint-disable-line no-new-wrappers
Location: new String(location) // eslint-disable-line no-new-wrappers
Location: new String(location),
// eslint-disable-line no-new-wrappers
Prop_Build: {
Filter: {
Name: 'Adobe.PPKLite'
},
...(appName ? {
App: {
Name: appName
}
} : {})
}
});

// Check if pdf already contains acroform field
Expand Down
6 changes: 5 additions & 1 deletion packages/placeholder-plain/dist/plainAddPlaceholder.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function plainAddPlaceholder({ pdfBuffer, reason, contactInfo, name, location, signingTime, signatureLength, subFilter, widgetRect, }: InputType): Buffer;
export function plainAddPlaceholder({ pdfBuffer, reason, contactInfo, name, location, signingTime, signatureLength, subFilter, widgetRect, appName, }: InputType): Buffer;
export type InputType = {
pdfBuffer: Buffer;
reason: string;
Expand All @@ -15,5 +15,9 @@ export type InputType = {
* [x1, y1, x2, y2] widget rectangle
*/
widgetRect?: number[];
/**
* Name of the application generating the signature
*/
appName?: string;
};
//# sourceMappingURL=plainAddPlaceholder.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions packages/placeholder-plain/dist/plainAddPlaceholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const getAcroFormRef = slice => {
* @property {number} [signatureLength]
* @property {string} [subFilter] One of SUBFILTER_* from \@signpdf/utils
* @property {number[]} [widgetRect] [x1, y1, x2, y2] widget rectangle
* @property {string} [appName] Name of the application generating the signature
*/

/**
Expand All @@ -62,7 +63,8 @@ const plainAddPlaceholder = ({
signingTime = undefined,
signatureLength = _utils.DEFAULT_SIGNATURE_LENGTH,
subFilter = _utils.SUBFILTER_ADOBE_PKCS7_DETACHED,
widgetRect = [0, 0, 0, 0]
widgetRect = [0, 0, 0, 0],
appName = undefined
}) => {
let pdf = (0, _utils.removeTrailingNewLine)(pdfBuffer);
const info = (0, _readPdf.default)(pdf);
Expand Down Expand Up @@ -106,7 +108,8 @@ const plainAddPlaceholder = ({
signingTime,
signatureLength,
subFilter,
widgetRect
widgetRect,
appName
});
if (!getAcroFormRef(pdf.toString())) {
const rootIndex = (0, _getIndexFromRef.default)(info.xref, info.rootRef);
Expand Down

0 comments on commit 95a4e6d

Please sign in to comment.