@compdfkit_pdf_sdk/react_native
Version:
ComPDFKit for React Native is a comprehensive SDK that allows you to quickly add PDF functionality to Android, iOS, and React Native applications.
55 lines (51 loc) • 1.87 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CPDFSignatureWidget = void 0;
var _CPDFWidget = require("./CPDFWidget");
var _reactNative = require("react-native");
/**
* Copyright © 2014-2025 PDF Technologies, Inc. All Rights Reserved.
*
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
* This notice may not be removed from this file.
*/
const {
CPDFViewManager
} = _reactNative.NativeModules;
/**
* Class representing a signature form widget, storing basic information about the signature form.
* It includes general form attributes as well as the signature content.
*
* @class CPDFSignatureWidget
* @memberof CPDFSignatureWidget
*/
class CPDFSignatureWidget extends _CPDFWidget.CPDFWidget {
constructor(viewerRef, params) {
super(viewerRef, params);
}
/**
* Adds an image signature to the widget.
* @param imagePath The path of the image to be added as a signature.
* @example
* android support uri format:
* await widget.addImageSignature('content://media/external/images/media/123');
* file path:
* await widget.addImageSignature('/path/to/image');
* // update the appearance
* await widget.updateAp();
* @returns
*/
addImageSignature = imagePath => {
const tag = (0, _reactNative.findNodeHandle)(this._viewerRef);
if (tag != null) {
return CPDFViewManager.addWidgetImageSignature(tag, this.page, this.uuid, imagePath);
}
return Promise.reject(new Error('Unable to find the native view reference'));
};
}
exports.CPDFSignatureWidget = CPDFSignatureWidget;
//# sourceMappingURL=CPDFSignatureWidget.js.map
;