@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.44 kB
JavaScript
/**
* 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.
*/
import { CPDFEditType } from "../configuration/CPDFOptions";
import { CPDFEditArea } from "./CPDFEditArea";
export class CPDFEditImageArea extends CPDFEditArea {
alpha;
image;
constructor(params) {
super({ type: CPDFEditType.IMAGE, uuid: params.uuid, page: params.page });
this.alpha = params.alpha ?? 255;
this.image = params.image ?? null;
}
static fromJson(json) {
let image = null;
if (typeof json?.image === "string") {
image = json.image;
}
else {
image = null;
}
return new CPDFEditImageArea({
uuid: json?.uuid ?? '',
page: Number(json?.page ?? 0),
alpha: Number((json?.alpha ?? 255)),
image,
});
}
toJson() {
return {
type: 'image',
uuid: this.uuid,
page: this.page,
alpha: this.alpha,
image: this.image,
};
}
}
//# sourceMappingURL=CPDFEditImageArea.js.map