@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.
62 lines • 2.26 kB
JavaScript
"use strict";
/**
* 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.CPDFEditTextArea = void 0;
const CPDFOptions_1 = require("../configuration/CPDFOptions");
const CPDFEditArea_1 = require("./CPDFEditArea");
class CPDFEditTextArea extends CPDFEditArea_1.CPDFEditArea {
text;
alignment;
fontSize;
color;
// 0-255
alpha;
familyName;
styleName;
constructor(params) {
super({ type: CPDFOptions_1.CPDFEditType.TEXT, uuid: params.uuid, page: params.page });
this.text = params.text ?? '';
this.alignment = params.alignment ?? 'left';
this.fontSize = params.fontSize ?? 12.0;
this.color = params.color ?? '#000000';
this.alpha = params.alpha ?? 255;
this.familyName = params.familyName ?? 'Helvetica';
this.styleName = params.styleName ?? 'Regular';
}
static fromJson(json) {
return new CPDFEditTextArea({
uuid: json?.uuid ?? '',
page: Number(json?.page ?? 0),
text: json?.text ?? '',
alignment: json?.alignment ?? 'left',
fontSize: Number((json?.fontSize ?? 12.0)),
color: json?.color ?? '#000000',
alpha: Number((json?.alpha ?? 255)),
familyName: json?.familyName ?? 'Helvetica',
styleName: json?.styleName ?? 'Regular',
});
}
toJson() {
return {
type: 'text',
uuid: this.uuid,
page: this.page,
text: this.text,
alignment: this.alignment,
fontSize: this.fontSize,
color: this.color,
alpha: this.alpha,
familyName: this.familyName,
styleName: this.styleName,
};
}
}
exports.CPDFEditTextArea = CPDFEditTextArea;
//# sourceMappingURL=CPDFEditTextArea.js.map