UNPKG

@syncfusion/ej2-pdf

Version:

Feature-rich JavaScript PDF library with built-in support for loading and manipulating PDF document.

44 lines (43 loc) 1.71 kB
/** * Represents an internal embedded data value that stores identification information * along with its corresponding raw byte content. * * @private */ var _PdfEmbeddedDataValue = /** @class */ (function () { function _PdfEmbeddedDataValue(identification, dataValue) { if (identification && dataValue && dataValue.length > 0) { this._identification = identification; this._dataValue = dataValue; } else { throw new Error('Invalid constructor arguments: identification and non-empty dataValue are required.'); } } /** * Converts the internal embedded data value into a readable textual representation. * * @private * @returns {string} A formatted string describing the identification and hexadecimal byte content. */ _PdfEmbeddedDataValue.prototype._toString = function () { return ('EMBEDDED PDV { ' + ("identification " + this._identification.toString() + " ") + ("dataValue " + Array.from(this._dataValue).map(function (byte) { return byte.toString(16); }).join('') + " ") + '}'); }; /** * Converts the internal embedded data value into a JSON compatible representation. * * @private * @returns {any} A JSON object containing the identification and encoded data value. */ _PdfEmbeddedDataValue.prototype._toJson = function () { return { identification: this._identification._toJson(), dataValue: Array.from(this._dataValue).map(function (byte) { return byte.toString(16); }).join('') }; }; return _PdfEmbeddedDataValue; }()); export { _PdfEmbeddedDataValue };