/* istanbul ignore next */
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
define(["require", "exports", "./single-value-field", "./../../pages/enum", "./../../graphics/brushes/pdf-brush", "./pdf-numbers-convertor"], function (require, exports, single_value_field_1, enum_1, pdf_brush_1, pdf_numbers_convertor_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var PdfPageCountField = (function (_super) {
__extends(PdfPageCountField, _super);
function PdfPageCountField(font, arg2) {
var _this = _super.call(this) || this;
_this.internalNumberStyle = enum_1.PdfNumberStyle.Numeric;
Eif (typeof arg2 === 'undefined') {
_this.font = font;
}
else if (arg2 instanceof pdf_brush_1.PdfBrush) {
_this.font = font;
_this.brush = arg2;
}
else {
_this.font = font;
_this.bounds = arg2;
}
return _this;
}
Object.defineProperty(PdfPageCountField.prototype, "numberStyle", {
get: function () {
return this.internalNumberStyle;
},
set: function (value) {
this.internalNumberStyle = value;
},
enumerable: true,
configurable: true
});
PdfPageCountField.prototype.getValue = function (graphics) {
var result = null;
var page = this.getPageFromGraphics(graphics);
var document = page.section.parent.document;
var count = document.pages.count;
result = pdf_numbers_convertor_1.PdfNumbersConvertor.convert(count, this.numberStyle);
return result;
};
return PdfPageCountField;
}(single_value_field_1.PdfSingleValueField));
exports.PdfPageCountField = PdfPageCountField;
});
|