@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.
44 lines • 1.8 kB
JavaScript
import { safeParseEnumValue } from "../util/CPDFEnumUtils";
/**
* 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.
*/
export class CPDFTextStamp {
content;
date;
shape;
color;
constructor(params) {
this.content = params.content;
this.date = params.date;
this.shape = params.shape ?? CPDFTextStampShape.rect;
this.color = params.color ?? CPDFTextStampColor.white;
}
static fromJson(json) {
return new CPDFTextStamp({
content: json?.content ?? '',
date: json?.date ?? '',
shape: safeParseEnumValue(json?.shape, Object.values(CPDFTextStampShape), CPDFTextStampShape.rect),
color: safeParseEnumValue(json?.color, Object.values(CPDFTextStampColor), CPDFTextStampColor.white),
});
}
}
export var CPDFTextStampShape;
(function (CPDFTextStampShape) {
CPDFTextStampShape["rect"] = "rect";
CPDFTextStampShape["leftTriangle"] = "leftTriangle";
CPDFTextStampShape["rightTriangle"] = "rightTriangle";
CPDFTextStampShape["none"] = "none";
})(CPDFTextStampShape || (CPDFTextStampShape = {}));
export var CPDFTextStampColor;
(function (CPDFTextStampColor) {
CPDFTextStampColor["white"] = "white";
CPDFTextStampColor["red"] = "red";
CPDFTextStampColor["green"] = "green";
CPDFTextStampColor["blue"] = "blue";
})(CPDFTextStampColor || (CPDFTextStampColor = {}));
//# sourceMappingURL=CPDFTextStamp.js.map