| 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 | 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 15× 15× 15× 15× 15× 1× 1832× 1832× 1× 93× 93× 93× 1× 15× 15× 1× 15× 1× 90× 1× 1× 15× 15× 1× 15× 15× 1× 15× 1× 10× 10× 1× 15× 15× 15× 15× 15× 1× 15× 15× 15× 15× 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", "./pdf-page-base", "./../primitives/pdf-dictionary", "./../primitives/pdf-name", "./../primitives/pdf-reference", "./../drawing/pdf-drawing", "./../annotations/annotation-collection", "./pdf-page-layer"], function (require, exports, pdf_page_base_1, pdf_dictionary_1, pdf_name_1, pdf_reference_1, pdf_drawing_1, annotation_collection_1, pdf_page_layer_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PdfPage = (function (_super) { __extends(PdfPage, _super); function PdfPage() { var _this = _super.call(this, new pdf_dictionary_1.PdfDictionary()) || this; _this.annotationCollection = null; _this.beginSave = null; _this.initialize(); return _this; } Object.defineProperty(PdfPage.prototype, "document", { get: function () { Eif (this.section !== null && this.section.parent !== null) { return this.section.parent.document; } else { return null; } }, enumerable: true, configurable: true }); Object.defineProperty(PdfPage.prototype, "graphics", { get: function () { var result = this.defaultLayer.graphics; result.currentPage = this; return result; }, enumerable: true, configurable: true }); Object.defineProperty(PdfPage.prototype, "crossTable", { get: function () { Iif (this.section === null) { throw new Error('PdfDocumentException : Page is not created'); } return this.section.parent === null ? this.section.parentDocument.crossTable : this.section.parent.document.crossTable; }, enumerable: true, configurable: true }); Object.defineProperty(PdfPage.prototype, "size", { get: function () { return this.section.pageSettings.size; }, enumerable: true, configurable: true }); Object.defineProperty(PdfPage.prototype, "origin", { get: function () { return this.section.pageSettings.origin; }, enumerable: true, configurable: true }); Object.defineProperty(PdfPage.prototype, "annotations", { get: function () { if (this.annotationCollection == null) { this.annotationCollection = new annotation_collection_1.PdfAnnotationCollection(this); this.dictionary.items.setValue(this.dictionaryProperties.annots, this.annotationCollection.element); this.annotationCollection.annotations = this.dictionary.items.getValue(this.dictionaryProperties.annots); } return this.annotationCollection; }, enumerable: true, configurable: true }); PdfPage.prototype.initialize = function () { this.dictionary.items.setValue(this.dictionaryProperties.type, new pdf_name_1.PdfName('Page')); this.dictionary.pageBeginDrawTemplate = new pdf_dictionary_1.SaveTemplateEventHandler(this); }; PdfPage.prototype.setSection = function (section) { this.section = section; this.dictionary.items.setValue(this.dictionaryProperties.parent, new pdf_reference_1.PdfReferenceHolder(section)); }; PdfPage.prototype.resetProgress = function () { this.isProgressOn = false; }; PdfPage.prototype.getClientSize = function () { var returnValue = this.section.getActualBounds(this, true); return new pdf_drawing_1.SizeF(returnValue.width, returnValue.height); }; PdfPage.prototype.pageBeginSave = function () { var doc = this.document; Eif (typeof doc !== undefined && doc != null) { this.drawPageTemplates(doc); } Eif (this.beginSave != null && typeof this.beginSave !== 'undefined') { this.beginSave(this); } }; PdfPage.prototype.drawPageTemplates = function (document) { var hasBackTemplates = this.section.containsTemplates(document, this, false); Iif (hasBackTemplates) { var backLayer = new pdf_page_layer_1.PdfPageLayer(this, false); this.layers.insert(0, backLayer); this.section.drawTemplates(this, backLayer, document, false); if (backLayer.graphics !== null && typeof backLayer.graphics !== 'undefined') { for (var i = 0; i < backLayer.graphics.automaticFields.automaticFields.length; i++) { var fieldInfo = backLayer.graphics.automaticFields.automaticFields[i]; fieldInfo.field.performDraw(backLayer.graphics, fieldInfo.location, fieldInfo.scalingX, fieldInfo.scalingY); } } } var hasFrontTemplates = this.section.containsTemplates(document, this, true); Iif (hasFrontTemplates) { var frontLayer = new pdf_page_layer_1.PdfPageLayer(this, false); this.layers.add(frontLayer); this.section.drawTemplates(this, frontLayer, document, true); } }; return PdfPage; }(pdf_page_base_1.PdfPageBase)); exports.PdfPage = PdfPage; }); |