UNPKG

@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.

33 lines (32 loc) 1.42 kB
/** * 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. */ /** * @class CPDFTextAttribute * This class is used to represent text attributes, including color, font name, font size, bold and italic, etc. * @property {string} [color] - The color of the text in hex format (e.g., '#FF0000' for red). * @property {string} [fontName] - The name of the font used for the text. * @property {number} [fontSize] - The size of the font in points. * @property {boolean} [isBold] - Indicates whether the text is bold. * @property {boolean} [isItalic] - Indicates whether the text is italic. * @see CPDFFreeTextAnnotation */ export class CPDFTextAttribute { constructor(params) { this.color = params.color ?? '#000000'; this.familyName = params.familyName ?? ''; this.styleName = params.styleName ?? ''; this.fontSize = params.fontSize ?? 0; this.isBold = params.isBold ?? false; this.isItalic = params.isItalic ?? false; } static fromJson(json) { return new CPDFTextAttribute(json); } } //# sourceMappingURL=CPDFTextAttribute.js.map