all files / graphics/ pdf-margins.js

64.71% Statements 22/34
25% Branches 1/4
64.29% Functions 9/14
64.71% Lines 22/34
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       25×                 25×                 25×                 25×                                                              
define(["require", "exports"], function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var PdfMargins = (function () {
        function PdfMargins() {
            this.pdfMargin = 40.0;
            this.setMargins(this.pdfMargin);
        }
        Object.defineProperty(PdfMargins.prototype, "left", {
            get: function () {
                return this.leftMargin;
            },
            set: function (value) {
                this.leftMargin = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfMargins.prototype, "top", {
            get: function () {
                return this.topMargin;
            },
            set: function (value) {
                this.topMargin = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfMargins.prototype, "right", {
            get: function () {
                return this.rightMargin;
            },
            set: function (value) {
                this.rightMargin = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfMargins.prototype, "bottom", {
            get: function () {
                return this.bottomMargin;
            },
            set: function (value) {
                this.bottomMargin = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PdfMargins.prototype, "all", {
            set: function (value) {
                this.setMargins(value);
            },
            enumerable: true,
            configurable: true
        });
        PdfMargins.prototype.setMargins = function (margin1, margin2, margin3, margin4) {
            Eif (typeof margin2 === 'undefined') {
                this.leftMargin = this.topMargin = this.rightMargin = this.bottomMargin = margin1;
            }
            else {
                if (typeof margin3 === 'undefined') {
                    this.leftMargin = this.rightMargin = margin1;
                    this.bottomMargin = this.topMargin = margin2;
                }
                else {
                    this.leftMargin = margin1;
                    this.topMargin = margin2;
                    this.rightMargin = margin3;
                    this.bottomMargin = margin4;
                }
            }
        };
        PdfMargins.prototype.clone = function () {
            return this;
        };
        return PdfMargins;
    }());
    exports.PdfMargins = PdfMargins;
});