| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 3× 3× 3× 3× 1× 90× 1× 10× 1× 20× 1× 3× 1× 1× 1× 10× 1× 20× 1× 10× 10× 10× 1× 10× 10× 10× 10× 10× 1× 20× 20× 1× 1× 10× 1× 20× 1× 40× 40× 40× 1× 1× | /* 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", "./../../drawing/pdf-drawing", "./../../graphics/brushes/pdf-solid-brush", "./../../graphics/pdf-color", "./../pdf-document", "./../../graphics/figures/base/graphics-element", "./automatic-field-info"], function (require, exports, pdf_drawing_1, pdf_solid_brush_1, pdf_color_1, pdf_document_1, graphics_element_1, automatic_field_info_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PdfAutomaticField = (function (_super) { __extends(PdfAutomaticField, _super); function PdfAutomaticField() { var _this = _super.call(this) || this; _this.internalBounds = new pdf_drawing_1.RectangleF(0, 0, 0, 0); _this.internalTemplateSize = new pdf_drawing_1.SizeF(0, 0); return _this; } Object.defineProperty(PdfAutomaticField.prototype, "bounds", { get: function () { return this.internalBounds; }, set: function (value) { this.internalBounds = value; }, enumerable: true, configurable: true }); Object.defineProperty(PdfAutomaticField.prototype, "size", { get: function () { return new pdf_drawing_1.SizeF(this.bounds.width, this.bounds.height); }, set: function (value) { this.bounds.width = value.width; this.bounds.height = value.height; }, enumerable: true, configurable: true }); Object.defineProperty(PdfAutomaticField.prototype, "location", { get: function () { return new pdf_drawing_1.PointF(this.bounds.x, this.bounds.y); }, set: function (value) { this.bounds.x = value.x; this.bounds.y = value.y; }, enumerable: true, configurable: true }); Object.defineProperty(PdfAutomaticField.prototype, "font", { get: function () { return this.internalFont; }, set: function (value) { this.internalFont = value; }, enumerable: true, configurable: true }); Object.defineProperty(PdfAutomaticField.prototype, "brush", { get: function () { return this.internalBrush; }, set: function (value) { this.internalBrush = value; }, enumerable: true, configurable: true }); Object.defineProperty(PdfAutomaticField.prototype, "pen", { get: function () { return this.internalPen; }, set: function (value) { this.internalPen = value; }, enumerable: true, configurable: true }); Object.defineProperty(PdfAutomaticField.prototype, "stringFormat", { get: function () { return this.internalStringFormat; }, set: function (value) { this.internalStringFormat = value; }, enumerable: true, configurable: true }); PdfAutomaticField.prototype.performDrawHelper = function (graphics, location, scalingX, scalingY) { Eif (this.bounds.height === 0 || this.bounds.width === 0) { var text = this.getValue(graphics); this.internalTemplateSize = this.getFont().measureString(text, this.size, this.stringFormat); } }; PdfAutomaticField.prototype.draw = function (arg1, arg2, arg3) { Iif (typeof arg2 === 'undefined') { var location_1 = new pdf_drawing_1.PointF(0, 0); this.draw(arg1, location_1); } else Iif (arg2 instanceof pdf_drawing_1.PointF) { this.draw(arg1, arg2.x, arg2.y); } else { this.drawHelper(arg1, arg2, arg3); var info = new automatic_field_info_1.PdfAutomaticFieldInfo(this, new pdf_drawing_1.PointF(arg2, arg3)); arg1.automaticFields.add(info); } }; PdfAutomaticField.prototype.getSize = function () { Eif (this.bounds.height === 0 || this.bounds.width === 0) { return this.internalTemplateSize; } else { return this.size; } }; PdfAutomaticField.prototype.drawInternal = function (graphics) { }; PdfAutomaticField.prototype.getBrush = function () { return (typeof this.internalBrush === 'undefined' || this.internalBrush == null) ? new pdf_solid_brush_1.PdfSolidBrush(new pdf_color_1.PdfColor(0, 0, 0)) : this.internalBrush; }; PdfAutomaticField.prototype.getFont = function () { return (typeof this.internalFont === 'undefined' || this.internalFont == null) ? pdf_document_1.PdfDocument.defaultFont : this.internalFont; }; PdfAutomaticField.prototype.getPageFromGraphics = function (graphics) { Eif (typeof graphics.page !== 'undefined' && graphics.page !== null) { var page = graphics.page; return page; } else { var page = graphics.currentPage; return page; } }; return PdfAutomaticField; }(graphics_element_1.PdfGraphicsElement)); exports.PdfAutomaticField = PdfAutomaticField; }); |