UNPKG

@adobe/pdfservices-node-sdk

Version:

The Adobe PDF Services Node.js SDK provides APIs for creating, combining, exporting and manipulating PDFs.

40 lines 1.32 kB
"use strict"; /* * 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.PageRange = void 0; const ObjectUtil_1 = require("../util/ObjectUtil"); class PageRange { constructor(start, end) { this._start = start; this._end = end; } validate() { ObjectUtil_1.ObjectUtil.requireValidNonNegativeInteger(this._start, "Start page index"); if (!ObjectUtil_1.ObjectUtil.isUndefinedOrNull(this._end)) { ObjectUtil_1.ObjectUtil.requireValidNonNegativeInteger(this._end, "End page index"); } if (this._start < 1 || (this._end && this._end < this._start)) { throw new RangeError("Invalid page range."); } } toString() { return `${this._start}-${this._end}`; } get start() { return this._start; } get end() { return this._end; } } exports.PageRange = PageRange; //# sourceMappingURL=PageRange.js.map