@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.
59 lines • 2.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CPDFStampAnnotation = void 0;
/**
* Copyright © 2014-2026 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 CPDFOptions_1 = require("../configuration/CPDFOptions");
const CPDFEnumUtils_1 = require("../util/CPDFEnumUtils");
const CPDFAnnotation_1 = require("./CPDFAnnotation");
const CPDFTextStamp_1 = require("./CPDFTextStamp");
/**
* @class CPDFStampAnnotation
* @group Annotations
* @property { CPDFStandardStamp } standardStamp - The standard stamp type.
* @property { CPDFStampType } stampType - The stamp type.
* @property { CPDFTextStamp } textStamp - The text stamp details.
*/
class CPDFStampAnnotation extends CPDFAnnotation_1.CPDFAnnotation {
/**
* * The standard stamp type.
* only applicable if stampType is STANDARD
*/
standardStamp;
/**
* The stamp type.
* standard - A predefined standard stamp.
* text - A custom text stamp.
*/
stampType;
/**
* The text stamp details.
* only applicable if stampType is TEXT
*/
textStamp;
constructor(params) {
super(params);
this.type = 'stamp';
this.standardStamp = (0, CPDFEnumUtils_1.safeParseEnumValue)(params.standardStamp, Object.values(CPDFOptions_1.CPDFStandardStamp), CPDFOptions_1.CPDFStandardStamp.UNKNOWN);
this.stampType = (0, CPDFEnumUtils_1.safeParseEnumValue)(params.stampType, Object.values(CPDFOptions_1.CPDFStampType), CPDFOptions_1.CPDFStampType.UNKNOWN);
if (params.textStamp !== undefined) {
this.textStamp = CPDFTextStamp_1.CPDFTextStamp.fromJson(params.textStamp);
}
}
toJSON() {
return {
...super.toJSON(),
standardStamp: this.standardStamp,
stampType: this.stampType,
textStamp: this.textStamp ? this.textStamp : undefined,
};
}
}
exports.CPDFStampAnnotation = CPDFStampAnnotation;
//# sourceMappingURL=CPDFStampAnnotation.js.map