@adobe/pdfservices-node-sdk
Version:
The Adobe PDF Services Node.js SDK provides APIs for creating, combining, exporting and manipulating PDFs.
41 lines • 1.73 kB
JavaScript
;
/*
* Copyright 2024 Adobe
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in
* accordance with the terms of the Adobe license agreement accompanying
* it. If you have received this file from a source other than Adobe,
* then your use, modification, or distribution of it requires the prior
* written permission of Adobe.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.PageActionCommand = void 0;
const DeletePageAction_1 = require("./DeletePageAction");
const RotatePageAction_1 = require("./RotatePageAction");
const ObjectUtil_1 = require("../../../util/ObjectUtil");
const SDKError_1 = require("../../../../exception/SDKError");
class PageActionCommand {
constructor(params) {
if (ObjectUtil_1.ObjectUtil.isUndefinedOrNull(params)) {
throw new SDKError_1.SDKError("PageActionCommand params cannot be undefined or null");
}
this._delete = params.deletePageAction;
this._rotate = params.rotatePageAction;
}
static createFrom(pageAction) {
let pageActionCommand;
if (pageAction instanceof DeletePageAction_1.DeletePageAction) {
pageActionCommand = new PageActionCommand({ deletePageAction: pageAction });
}
else if (pageAction instanceof RotatePageAction_1.RotatePageAction) {
pageActionCommand = new PageActionCommand({ rotatePageAction: pageAction });
}
else {
throw new SDKError_1.SDKError("PageActionCommand cannot be created from PageAction");
}
return pageActionCommand;
}
}
exports.PageActionCommand = PageActionCommand;
//# sourceMappingURL=PageActionCommand.js.map