@syncfusion/ej2-pdf-export 22.1.34 → 22.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/ej2-pdf-export.min.js +2 -2
- package/dist/ej2-pdf-export.umd.min.js +2 -2
- package/dist/ej2-pdf-export.umd.min.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es2015.js +748 -93
- package/dist/es6/ej2-pdf-export.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es5.js +933 -225
- package/dist/es6/ej2-pdf-export.es5.js.map +1 -1
- package/dist/global/ej2-pdf-export.min.js +2 -2
- package/dist/global/ej2-pdf-export.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/implementation/document/pdf-catalog.d.ts +7 -0
- package/src/implementation/document/pdf-catalog.js +16 -0
- package/src/implementation/document/pdf-document-base.d.ts +13 -0
- package/src/implementation/document/pdf-document-base.js +18 -0
- package/src/implementation/document/pdf-viewer-preferences.d.ts +467 -0
- package/src/implementation/document/pdf-viewer-preferences.js +624 -0
- package/src/implementation/input-output/pdf-dictionary-properties.d.ts +55 -0
- package/src/implementation/input-output/pdf-dictionary-properties.js +55 -0
- package/dist/ts/implementation/actions/action.ts +0 -76
- package/dist/ts/implementation/actions/uri-action.ts +0 -52
- package/dist/ts/implementation/annotations/action-link-annotation.ts +0 -43
- package/dist/ts/implementation/annotations/annotation-collection.ts +0 -159
- package/dist/ts/implementation/annotations/annotation.ts +0 -241
- package/dist/ts/implementation/annotations/document-link-annotation.ts +0 -118
- package/dist/ts/implementation/annotations/link-annotation.ts +0 -32
- package/dist/ts/implementation/annotations/pdf-text-web-link.ts +0 -265
- package/dist/ts/implementation/annotations/uri-annotation.ts +0 -86
- package/dist/ts/implementation/collections/dictionary.ts +0 -150
- package/dist/ts/implementation/collections/object-object-pair/dictionary.ts +0 -125
- package/dist/ts/implementation/collections/utils.ts +0 -38
- package/dist/ts/implementation/document/automatic-fields/automatic-field-info-collection.ts +0 -39
- package/dist/ts/implementation/document/automatic-fields/automatic-field-info.ts +0 -108
- package/dist/ts/implementation/document/automatic-fields/automatic-field.ts +0 -127
- package/dist/ts/implementation/document/automatic-fields/composite-field.ts +0 -76
- package/dist/ts/implementation/document/automatic-fields/multiple-value-field.ts +0 -37
- package/dist/ts/implementation/document/automatic-fields/page-count-field.ts +0 -75
- package/dist/ts/implementation/document/automatic-fields/pdf-numbers-convertor.ts +0 -157
- package/dist/ts/implementation/document/automatic-fields/pdf-page-number-field.ts +0 -82
- package/dist/ts/implementation/document/automatic-fields/pdf-template-value-pair.ts +0 -60
- package/dist/ts/implementation/document/automatic-fields/single-value-field.ts +0 -48
- package/dist/ts/implementation/document/pdf-catalog.ts +0 -52
- package/dist/ts/implementation/document/pdf-document-base.ts +0 -166
- package/dist/ts/implementation/document/pdf-document-template.ts +0 -310
- package/dist/ts/implementation/document/pdf-document.ts +0 -342
- package/dist/ts/implementation/drawing/pdf-drawing.ts +0 -218
- package/dist/ts/implementation/general/enum.ts +0 -21
- package/dist/ts/implementation/general/functions/pdf-function.ts +0 -66
- package/dist/ts/implementation/general/functions/pdf-sampled-function.ts +0 -62
- package/dist/ts/implementation/general/pdf-cache-collection.ts +0 -97
- package/dist/ts/implementation/general/pdf-collection.ts +0 -41
- package/dist/ts/implementation/general/pdf-destination.ts +0 -170
- package/dist/ts/implementation/graphics/brushes/enum.ts +0 -237
- package/dist/ts/implementation/graphics/brushes/pdf-blend.ts +0 -294
- package/dist/ts/implementation/graphics/brushes/pdf-brush.ts +0 -68
- package/dist/ts/implementation/graphics/brushes/pdf-brushes.ts +0 -2438
- package/dist/ts/implementation/graphics/brushes/pdf-color-blend.ts +0 -295
- package/dist/ts/implementation/graphics/brushes/pdf-gradient-brush.ts +0 -311
- package/dist/ts/implementation/graphics/brushes/pdf-linear-gradient-brush.ts +0 -406
- package/dist/ts/implementation/graphics/brushes/pdf-radial-gradient-brush.ts +0 -290
- package/dist/ts/implementation/graphics/brushes/pdf-solid-brush.ts +0 -107
- package/dist/ts/implementation/graphics/brushes/pdf-tiling-brush.ts +0 -304
- package/dist/ts/implementation/graphics/constants.ts +0 -31
- package/dist/ts/implementation/graphics/enum.ts +0 -413
- package/dist/ts/implementation/graphics/figures/arc.ts +0 -133
- package/dist/ts/implementation/graphics/figures/base/draw-element.ts +0 -59
- package/dist/ts/implementation/graphics/figures/base/element-layouter.ts +0 -260
- package/dist/ts/implementation/graphics/figures/base/fill-element.ts +0 -72
- package/dist/ts/implementation/graphics/figures/base/graphics-element.ts +0 -34
- package/dist/ts/implementation/graphics/figures/base/pdf-shape-element.ts +0 -69
- package/dist/ts/implementation/graphics/figures/base/shape-layouter.ts +0 -276
- package/dist/ts/implementation/graphics/figures/base/text-layouter.ts +0 -205
- package/dist/ts/implementation/graphics/figures/ellipse-part.ts +0 -76
- package/dist/ts/implementation/graphics/figures/enum.ts +0 -80
- package/dist/ts/implementation/graphics/figures/layout-element.ts +0 -132
- package/dist/ts/implementation/graphics/figures/path.ts +0 -646
- package/dist/ts/implementation/graphics/figures/pdf-template.ts +0 -205
- package/dist/ts/implementation/graphics/figures/rectangle-area.ts +0 -108
- package/dist/ts/implementation/graphics/figures/text-element.ts +0 -445
- package/dist/ts/implementation/graphics/fonts/enum.ts +0 -385
- package/dist/ts/implementation/graphics/fonts/pdf-font-metrics.ts +0 -248
- package/dist/ts/implementation/graphics/fonts/pdf-font.ts +0 -316
- package/dist/ts/implementation/graphics/fonts/pdf-standard-font-metrics-factory.ts +0 -606
- package/dist/ts/implementation/graphics/fonts/pdf-standard-font.ts +0 -243
- package/dist/ts/implementation/graphics/fonts/pdf-string-format.ts +0 -474
- package/dist/ts/implementation/graphics/fonts/pdf-true-type-font.ts +0 -165
- package/dist/ts/implementation/graphics/fonts/rtl/rtl-bidirectional.ts +0 -958
- package/dist/ts/implementation/graphics/fonts/rtl/rtl-text-shape.ts +0 -374
- package/dist/ts/implementation/graphics/fonts/rtl-renderer.ts +0 -255
- package/dist/ts/implementation/graphics/fonts/string-layouter.ts +0 -617
- package/dist/ts/implementation/graphics/fonts/string-tokenizer.ts +0 -275
- package/dist/ts/implementation/graphics/fonts/ttf-OS2-Table.ts +0 -206
- package/dist/ts/implementation/graphics/fonts/ttf-apple-cmap-sub-table.ts +0 -18
- package/dist/ts/implementation/graphics/fonts/ttf-cmap-sub-table.ts +0 -18
- package/dist/ts/implementation/graphics/fonts/ttf-cmap-table.ts +0 -14
- package/dist/ts/implementation/graphics/fonts/ttf-glyph-header.ts +0 -26
- package/dist/ts/implementation/graphics/fonts/ttf-glyph-info.ts +0 -35
- package/dist/ts/implementation/graphics/fonts/ttf-head-table.ts +0 -94
- package/dist/ts/implementation/graphics/fonts/ttf-horizontal-header-table.ts +0 -56
- package/dist/ts/implementation/graphics/fonts/ttf-loca-table.ts +0 -10
- package/dist/ts/implementation/graphics/fonts/ttf-long-hor-metric.ts +0 -14
- package/dist/ts/implementation/graphics/fonts/ttf-metrics.ts +0 -106
- package/dist/ts/implementation/graphics/fonts/ttf-microsoft-cmap-sub-table.ts +0 -58
- package/dist/ts/implementation/graphics/fonts/ttf-name-record.ts +0 -33
- package/dist/ts/implementation/graphics/fonts/ttf-name-table.ts +0 -22
- package/dist/ts/implementation/graphics/fonts/ttf-post-table.ts +0 -42
- package/dist/ts/implementation/graphics/fonts/ttf-reader.ts +0 -1254
- package/dist/ts/implementation/graphics/fonts/ttf-table-info.ts +0 -26
- package/dist/ts/implementation/graphics/fonts/ttf-trimmed-cmap-sub-table.ts +0 -26
- package/dist/ts/implementation/graphics/fonts/unicode-true-type-font.ts +0 -577
- package/dist/ts/implementation/graphics/images/byte-array.ts +0 -137
- package/dist/ts/implementation/graphics/images/image-decoder.ts +0 -439
- package/dist/ts/implementation/graphics/images/pdf-bitmap.ts +0 -110
- package/dist/ts/implementation/graphics/images/pdf-image.ts +0 -132
- package/dist/ts/implementation/graphics/pdf-color.ts +0 -478
- package/dist/ts/implementation/graphics/pdf-graphics.ts +0 -2424
- package/dist/ts/implementation/graphics/pdf-margins.ts +0 -124
- package/dist/ts/implementation/graphics/pdf-pen.ts +0 -370
- package/dist/ts/implementation/graphics/pdf-resources.ts +0 -300
- package/dist/ts/implementation/graphics/pdf-transformation-matrix.ts +0 -246
- package/dist/ts/implementation/graphics/pdf-transparency.ts +0 -93
- package/dist/ts/implementation/graphics/unit-convertor.ts +0 -96
- package/dist/ts/implementation/input-output/big-endian-writer.ts +0 -121
- package/dist/ts/implementation/input-output/cross-table.ts +0 -21
- package/dist/ts/implementation/input-output/enum.ts +0 -16
- package/dist/ts/implementation/input-output/pdf-cross-table.ts +0 -524
- package/dist/ts/implementation/input-output/pdf-dictionary-properties.ts +0 -515
- package/dist/ts/implementation/input-output/pdf-main-object-collection.ts +0 -194
- package/dist/ts/implementation/input-output/pdf-operators.ts +0 -363
- package/dist/ts/implementation/input-output/pdf-stream-writer.ts +0 -681
- package/dist/ts/implementation/input-output/pdf-writer.ts +0 -88
- package/dist/ts/implementation/pages/enum.ts +0 -201
- package/dist/ts/implementation/pages/page-added-event-arguments.ts +0 -39
- package/dist/ts/implementation/pages/pdf-document-page-collection.ts +0 -180
- package/dist/ts/implementation/pages/pdf-page-base.ts +0 -181
- package/dist/ts/implementation/pages/pdf-page-layer-collection.ts +0 -348
- package/dist/ts/implementation/pages/pdf-page-layer.ts +0 -271
- package/dist/ts/implementation/pages/pdf-page-settings.ts +0 -192
- package/dist/ts/implementation/pages/pdf-page-size.ts +0 -162
- package/dist/ts/implementation/pages/pdf-page-template-element.ts +0 -659
- package/dist/ts/implementation/pages/pdf-page.ts +0 -235
- package/dist/ts/implementation/pages/pdf-section-collection.ts +0 -187
- package/dist/ts/implementation/pages/pdf-section-page-collection.ts +0 -61
- package/dist/ts/implementation/pages/pdf-section-templates.ts +0 -96
- package/dist/ts/implementation/pages/pdf-section.ts +0 -644
- package/dist/ts/implementation/primitives/pdf-array.ts +0 -386
- package/dist/ts/implementation/primitives/pdf-boolean.ts +0 -119
- package/dist/ts/implementation/primitives/pdf-dictionary.ts +0 -513
- package/dist/ts/implementation/primitives/pdf-name.ts +0 -218
- package/dist/ts/implementation/primitives/pdf-number.ts +0 -165
- package/dist/ts/implementation/primitives/pdf-reference.ts +0 -430
- package/dist/ts/implementation/primitives/pdf-stream.ts +0 -336
- package/dist/ts/implementation/primitives/pdf-string.ts +0 -397
- package/dist/ts/implementation/structured-elements/grid/layout/grid-layouter.ts +0 -2027
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-cell.ts +0 -1193
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-column.ts +0 -206
- package/dist/ts/implementation/structured-elements/grid/pdf-grid-row.ts +0 -470
- package/dist/ts/implementation/structured-elements/grid/pdf-grid.ts +0 -853
- package/dist/ts/implementation/structured-elements/grid/styles/pdf-borders.ts +0 -240
- package/dist/ts/implementation/structured-elements/grid/styles/style.ts +0 -424
- package/dist/ts/implementation/structured-elements/tables/light-tables/enum.ts +0 -16
- package/dist/ts/interfaces/i-pdf-cache.ts +0 -23
- package/dist/ts/interfaces/i-pdf-changable.ts +0 -17
- package/dist/ts/interfaces/i-pdf-clonable.ts +0 -12
- package/dist/ts/interfaces/i-pdf-primitives.ts +0 -45
- package/dist/ts/interfaces/i-pdf-true-type-font.ts +0 -48
- package/dist/ts/interfaces/i-pdf-wrapper.ts +0 -13
- package/dist/ts/interfaces/i-pdf-writer.ts +0 -29
|
@@ -1238,6 +1238,61 @@ var DictionaryProperties = /** @__PURE__ @class */ (function () {
|
|
|
1238
1238
|
* @private
|
|
1239
1239
|
*/
|
|
1240
1240
|
this.yStep = 'YStep';
|
|
1241
|
+
/**
|
|
1242
|
+
* Specifies the value of viewer preferences.
|
|
1243
|
+
* @private
|
|
1244
|
+
*/
|
|
1245
|
+
this.viewerPreferences = 'ViewerPreferences';
|
|
1246
|
+
/**
|
|
1247
|
+
* Specifies the value of center window.
|
|
1248
|
+
* @private
|
|
1249
|
+
*/
|
|
1250
|
+
this.centerWindow = 'CenterWindow';
|
|
1251
|
+
/**
|
|
1252
|
+
* Specifies the value of display title.
|
|
1253
|
+
* @private
|
|
1254
|
+
*/
|
|
1255
|
+
this.displayTitle = 'DisplayTitle';
|
|
1256
|
+
/**
|
|
1257
|
+
* Specifies the value of fit window.
|
|
1258
|
+
* @private
|
|
1259
|
+
*/
|
|
1260
|
+
this.fitWindow = 'FitWindow';
|
|
1261
|
+
/**
|
|
1262
|
+
* Specifies the value of hide menu bar.
|
|
1263
|
+
* @private
|
|
1264
|
+
*/
|
|
1265
|
+
this.hideMenuBar = 'HideMenubar';
|
|
1266
|
+
/**
|
|
1267
|
+
* Specifies the value of hide tool bar.
|
|
1268
|
+
* @private
|
|
1269
|
+
*/
|
|
1270
|
+
this.hideToolBar = 'HideToolbar';
|
|
1271
|
+
/**
|
|
1272
|
+
* Specifies the value of hide window UI.
|
|
1273
|
+
* @private
|
|
1274
|
+
*/
|
|
1275
|
+
this.hideWindowUI = 'HideWindowUI';
|
|
1276
|
+
/**
|
|
1277
|
+
* Specifies the value of page mode.
|
|
1278
|
+
* @private
|
|
1279
|
+
*/
|
|
1280
|
+
this.pageMode = 'PageMode';
|
|
1281
|
+
/**
|
|
1282
|
+
* Specifies the value of page layout.
|
|
1283
|
+
* @private
|
|
1284
|
+
*/
|
|
1285
|
+
this.pageLayout = 'PageLayout';
|
|
1286
|
+
/**
|
|
1287
|
+
* Specifies the value of duplex.
|
|
1288
|
+
* @private
|
|
1289
|
+
*/
|
|
1290
|
+
this.duplex = 'Duplex';
|
|
1291
|
+
/**
|
|
1292
|
+
* Specifies the value of print scaling.
|
|
1293
|
+
* @private
|
|
1294
|
+
*/
|
|
1295
|
+
this.printScaling = 'PrintScaling';
|
|
1241
1296
|
//
|
|
1242
1297
|
}
|
|
1243
1298
|
return DictionaryProperties;
|
|
@@ -6820,6 +6875,24 @@ var PdfDocumentBase = /** @__PURE__ @class */ (function () {
|
|
|
6820
6875
|
enumerable: true,
|
|
6821
6876
|
configurable: true
|
|
6822
6877
|
});
|
|
6878
|
+
Object.defineProperty(PdfDocumentBase.prototype, "viewerPreferences", {
|
|
6879
|
+
/**
|
|
6880
|
+
* Gets viewer preferences for presenting the PDF document in a viewer.
|
|
6881
|
+
* ```typescript
|
|
6882
|
+
* // Create a new PDF document
|
|
6883
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6884
|
+
* // Gets viewer preferences
|
|
6885
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6886
|
+
* // Destroy the document
|
|
6887
|
+
* document.destroy();
|
|
6888
|
+
* ```
|
|
6889
|
+
*/
|
|
6890
|
+
get: function () {
|
|
6891
|
+
return this.pdfCatalog.viewerPreferences;
|
|
6892
|
+
},
|
|
6893
|
+
enumerable: true,
|
|
6894
|
+
configurable: true
|
|
6895
|
+
});
|
|
6823
6896
|
//Public methods
|
|
6824
6897
|
/**
|
|
6825
6898
|
* Sets the `main object collection`.
|
|
@@ -6893,198 +6966,947 @@ var ObjectType;
|
|
|
6893
6966
|
ObjectType[ObjectType["Packed"] = 2] = "Packed";
|
|
6894
6967
|
})(ObjectType || (ObjectType = {}));
|
|
6895
6968
|
|
|
6896
|
-
var __extends$7 = (undefined && undefined.__extends) || (function () {
|
|
6897
|
-
var extendStatics = function (d, b) {
|
|
6898
|
-
extendStatics = Object.setPrototypeOf ||
|
|
6899
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6900
|
-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
6901
|
-
return extendStatics(d, b);
|
|
6902
|
-
};
|
|
6903
|
-
return function (d, b) {
|
|
6904
|
-
extendStatics(d, b);
|
|
6905
|
-
function __() { this.constructor = d; }
|
|
6906
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
6907
|
-
};
|
|
6908
|
-
})();
|
|
6909
|
-
/**
|
|
6910
|
-
* PdfCatalog.ts class for EJ2-PDF
|
|
6911
|
-
*/
|
|
6912
6969
|
/**
|
|
6913
|
-
* `
|
|
6970
|
+
* `PdfBoolean` class is used to perform boolean related primitive operations.
|
|
6914
6971
|
* @private
|
|
6915
6972
|
*/
|
|
6916
|
-
var
|
|
6917
|
-
__extends$7(PdfCatalog, _super);
|
|
6973
|
+
var PdfBoolean = /** @__PURE__ @class */ (function () {
|
|
6918
6974
|
//constructor
|
|
6919
6975
|
/**
|
|
6920
|
-
* Initializes a new instance of the `
|
|
6976
|
+
* Initializes a new instance of the `PdfBoolean` class.
|
|
6921
6977
|
* @private
|
|
6922
6978
|
*/
|
|
6923
|
-
function
|
|
6924
|
-
var _this = _super.call(this) || this;
|
|
6925
|
-
//fields
|
|
6926
|
-
/**
|
|
6927
|
-
* Internal variable to store collection of `sections`.
|
|
6928
|
-
* @default null
|
|
6929
|
-
* @private
|
|
6930
|
-
*/
|
|
6931
|
-
_this.sections = null;
|
|
6979
|
+
function PdfBoolean(value) {
|
|
6932
6980
|
/**
|
|
6933
|
-
* Internal variable
|
|
6981
|
+
* Internal variable to store the `position`.
|
|
6982
|
+
* @default -1
|
|
6934
6983
|
* @private
|
|
6935
6984
|
*/
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
return _this;
|
|
6985
|
+
this.currentPosition = -1;
|
|
6986
|
+
this.value = value;
|
|
6939
6987
|
}
|
|
6940
|
-
Object.defineProperty(
|
|
6988
|
+
Object.defineProperty(PdfBoolean.prototype, "status", {
|
|
6941
6989
|
//Properties
|
|
6942
6990
|
/**
|
|
6943
|
-
* Gets or sets the
|
|
6991
|
+
* Gets or sets the `Status` of the specified object.
|
|
6944
6992
|
* @private
|
|
6945
6993
|
*/
|
|
6946
6994
|
get: function () {
|
|
6947
|
-
return this.
|
|
6995
|
+
return this.objectStatus;
|
|
6948
6996
|
},
|
|
6949
6997
|
set: function (value) {
|
|
6950
|
-
|
|
6951
|
-
// if (this.sections !== value) {
|
|
6952
|
-
// this.sections = value;
|
|
6953
|
-
// this.Items.setValue(this.tempDictionaryProperties.pages, new PdfReferenceHolder(value));
|
|
6954
|
-
// }
|
|
6955
|
-
this.sections = value;
|
|
6956
|
-
this.items.setValue(this.tempDictionaryProperties.pages, new PdfReferenceHolder(value));
|
|
6998
|
+
this.objectStatus = value;
|
|
6957
6999
|
},
|
|
6958
7000
|
enumerable: true,
|
|
6959
7001
|
configurable: true
|
|
6960
7002
|
});
|
|
6961
|
-
|
|
6962
|
-
}(PdfDictionary));
|
|
6963
|
-
|
|
6964
|
-
/**
|
|
6965
|
-
* `PdfCrossTable` is responsible for intermediate level parsing
|
|
6966
|
-
* and savingof a PDF document.
|
|
6967
|
-
* @private
|
|
6968
|
-
*/
|
|
6969
|
-
var PdfCrossTable = /** @__PURE__ @class */ (function () {
|
|
6970
|
-
function PdfCrossTable() {
|
|
6971
|
-
/**
|
|
6972
|
-
* The modified `objects` that should be saved.
|
|
6973
|
-
* @private
|
|
6974
|
-
*/
|
|
6975
|
-
this.objects = new Dictionary();
|
|
6976
|
-
/**
|
|
6977
|
-
* Holds `maximal generation number` or offset to object.
|
|
6978
|
-
* @default 0
|
|
6979
|
-
* @private
|
|
6980
|
-
*/
|
|
6981
|
-
this.maxGenNumIndex = 0;
|
|
6982
|
-
/**
|
|
6983
|
-
* The `number of the objects`.
|
|
6984
|
-
* @default 0
|
|
6985
|
-
* @private
|
|
6986
|
-
*/
|
|
6987
|
-
this.objectCount = 0;
|
|
6988
|
-
/**
|
|
6989
|
-
* Internal variable for accessing fields from `DictionryProperties` class.
|
|
6990
|
-
* @default new PdfDictionaryProperties()
|
|
6991
|
-
* @private
|
|
6992
|
-
*/
|
|
6993
|
-
this.dictionaryProperties = new DictionaryProperties();
|
|
6994
|
-
}
|
|
6995
|
-
Object.defineProperty(PdfCrossTable.prototype, "isMerging", {
|
|
6996
|
-
//Properties
|
|
7003
|
+
Object.defineProperty(PdfBoolean.prototype, "isSaving", {
|
|
6997
7004
|
/**
|
|
6998
|
-
* Gets or sets
|
|
7005
|
+
* Gets or sets a value indicating whether this document `is saving` or not.
|
|
6999
7006
|
* @private
|
|
7000
7007
|
*/
|
|
7001
7008
|
get: function () {
|
|
7002
|
-
return this.
|
|
7009
|
+
return this.saving;
|
|
7003
7010
|
},
|
|
7004
7011
|
set: function (value) {
|
|
7005
|
-
this.
|
|
7012
|
+
this.saving = value;
|
|
7006
7013
|
},
|
|
7007
7014
|
enumerable: true,
|
|
7008
7015
|
configurable: true
|
|
7009
7016
|
});
|
|
7010
|
-
Object.defineProperty(
|
|
7017
|
+
Object.defineProperty(PdfBoolean.prototype, "objectCollectionIndex", {
|
|
7011
7018
|
/**
|
|
7012
|
-
* Gets the `
|
|
7019
|
+
* Gets or sets the `index` value of the specified object.
|
|
7013
7020
|
* @private
|
|
7014
7021
|
*/
|
|
7015
7022
|
get: function () {
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7023
|
+
return this.index;
|
|
7024
|
+
},
|
|
7025
|
+
set: function (value) {
|
|
7026
|
+
this.index = value;
|
|
7020
7027
|
},
|
|
7021
7028
|
enumerable: true,
|
|
7022
7029
|
configurable: true
|
|
7023
7030
|
});
|
|
7024
|
-
Object.defineProperty(
|
|
7031
|
+
Object.defineProperty(PdfBoolean.prototype, "position", {
|
|
7025
7032
|
/**
|
|
7026
|
-
* Gets or sets the
|
|
7033
|
+
* Gets or sets the `position` of the object.
|
|
7027
7034
|
* @private
|
|
7028
7035
|
*/
|
|
7029
7036
|
get: function () {
|
|
7030
|
-
return this.
|
|
7037
|
+
return this.currentPosition;
|
|
7031
7038
|
},
|
|
7032
7039
|
set: function (value) {
|
|
7033
|
-
this.
|
|
7034
|
-
this.items = this.pdfDocument.pdfObjects;
|
|
7040
|
+
this.currentPosition = value;
|
|
7035
7041
|
},
|
|
7036
7042
|
enumerable: true,
|
|
7037
7043
|
configurable: true
|
|
7038
7044
|
});
|
|
7039
|
-
Object.defineProperty(
|
|
7045
|
+
Object.defineProperty(PdfBoolean.prototype, "clonedObject", {
|
|
7040
7046
|
/**
|
|
7041
|
-
*
|
|
7047
|
+
* Returns `cloned object`.
|
|
7042
7048
|
* @private
|
|
7043
7049
|
*/
|
|
7044
7050
|
get: function () {
|
|
7045
|
-
|
|
7051
|
+
var rValue = null;
|
|
7052
|
+
return rValue;
|
|
7046
7053
|
},
|
|
7047
7054
|
enumerable: true,
|
|
7048
7055
|
configurable: true
|
|
7049
7056
|
});
|
|
7050
|
-
|
|
7057
|
+
/**
|
|
7058
|
+
* `Saves` the object using the specified writer.
|
|
7059
|
+
* @private
|
|
7060
|
+
*/
|
|
7061
|
+
PdfBoolean.prototype.save = function (writer) {
|
|
7062
|
+
writer.write(this.boolToStr(this.value));
|
|
7063
|
+
};
|
|
7064
|
+
/**
|
|
7065
|
+
* Creates a `copy of PdfBoolean`.
|
|
7066
|
+
* @private
|
|
7067
|
+
*/
|
|
7068
|
+
PdfBoolean.prototype.clone = function (crossTable) {
|
|
7069
|
+
var newNumber = new PdfBoolean(this.value);
|
|
7070
|
+
return newNumber;
|
|
7071
|
+
};
|
|
7072
|
+
// Implementation
|
|
7073
|
+
/**
|
|
7074
|
+
* Converts `boolean to string` - 0/1 'true'/'false'.
|
|
7075
|
+
* @private
|
|
7076
|
+
*/
|
|
7077
|
+
PdfBoolean.prototype.boolToStr = function (value) {
|
|
7078
|
+
return value ? 'true' : 'false';
|
|
7079
|
+
};
|
|
7080
|
+
return PdfBoolean;
|
|
7081
|
+
}());
|
|
7082
|
+
|
|
7083
|
+
/**
|
|
7084
|
+
* Defines the way the document is to be presented on the screen or in print.
|
|
7085
|
+
* ```typescript
|
|
7086
|
+
* // Create a new PDF document
|
|
7087
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7088
|
+
* // Gets viewer preferences
|
|
7089
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7090
|
+
* // Destroy the document
|
|
7091
|
+
* document.destroy();
|
|
7092
|
+
* ```
|
|
7093
|
+
*/
|
|
7094
|
+
var PdfViewerPreferences = /** @__PURE__ @class */ (function () {
|
|
7095
|
+
/**
|
|
7096
|
+
* Initialize a new instance of `PdfViewerPreferences` class.
|
|
7097
|
+
*
|
|
7098
|
+
* @private
|
|
7099
|
+
* ```
|
|
7100
|
+
*/
|
|
7101
|
+
function PdfViewerPreferences(catalog) {
|
|
7102
|
+
this._dictionaryProperties = new DictionaryProperties();
|
|
7103
|
+
this._centerWindow = false;
|
|
7104
|
+
this._fitWindow = false;
|
|
7105
|
+
this._displayTitle = false;
|
|
7106
|
+
this._splitWindow = false;
|
|
7107
|
+
this._hideMenuBar = false;
|
|
7108
|
+
this._hideToolBar = false;
|
|
7109
|
+
this._hideWindowUI = false;
|
|
7110
|
+
this._pageMode = PdfPageMode.UseNone;
|
|
7111
|
+
this._pageLayout = PdfPageLayout.SinglePage;
|
|
7112
|
+
this._dictionary = new PdfDictionary();
|
|
7113
|
+
this._duplex = DuplexMode.None;
|
|
7114
|
+
this._catalog = catalog;
|
|
7115
|
+
}
|
|
7116
|
+
Object.defineProperty(PdfViewerPreferences.prototype, "centerWindow", {
|
|
7051
7117
|
/**
|
|
7052
|
-
*
|
|
7053
|
-
*
|
|
7118
|
+
* A flag specifying whether to position the document’s window in the center of the screen.
|
|
7119
|
+
* ```typescript
|
|
7120
|
+
* // Create a new PDF document
|
|
7121
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7122
|
+
* // Gets the viewer preferences of the document
|
|
7123
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7124
|
+
* // Gets the center window
|
|
7125
|
+
* let centerWindow : boolean = viewerPreferences.centerWindow;
|
|
7126
|
+
* // Destroy the document
|
|
7127
|
+
* document.destroy();
|
|
7128
|
+
* ```
|
|
7054
7129
|
*/
|
|
7055
7130
|
get: function () {
|
|
7056
|
-
return this.
|
|
7131
|
+
return this._centerWindow;
|
|
7132
|
+
},
|
|
7133
|
+
/**
|
|
7134
|
+
* A flag specifying whether to position the document’s window in the center of the screen.
|
|
7135
|
+
* ```typescript
|
|
7136
|
+
* // Create a new PDF document
|
|
7137
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7138
|
+
* // Gets the viewer preferences of the document
|
|
7139
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7140
|
+
* // Sets the center window
|
|
7141
|
+
* viewerPreferences.centerWindow = true;
|
|
7142
|
+
* // Destroy the document
|
|
7143
|
+
* document.destroy();
|
|
7144
|
+
* ```
|
|
7145
|
+
*/
|
|
7146
|
+
set: function (value) {
|
|
7147
|
+
this._centerWindow = value;
|
|
7148
|
+
this._dictionary.items.setValue(this._dictionaryProperties.centerWindow, new PdfBoolean(this._centerWindow));
|
|
7057
7149
|
},
|
|
7058
7150
|
enumerable: true,
|
|
7059
7151
|
configurable: true
|
|
7060
7152
|
});
|
|
7061
|
-
Object.defineProperty(
|
|
7153
|
+
Object.defineProperty(PdfViewerPreferences.prototype, "displayTitle", {
|
|
7062
7154
|
/**
|
|
7063
|
-
*
|
|
7064
|
-
*
|
|
7155
|
+
* A flag specifying whether the window’s title bar should display the document title taken
|
|
7156
|
+
* from the Title entry of the document information dictionary. If false, the title bar
|
|
7157
|
+
* should instead display the name of the PDF file containing the document.
|
|
7158
|
+
* ```typescript
|
|
7159
|
+
* // Create a new PDF document
|
|
7160
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7161
|
+
* // Gets the viewer preferences of the document
|
|
7162
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7163
|
+
* // Gets the display title
|
|
7164
|
+
* let displayTitle : boolean = viewerPreferences.displayTitle;
|
|
7165
|
+
* // Destroy the document
|
|
7166
|
+
* document.destroy();
|
|
7167
|
+
* ```
|
|
7065
7168
|
*/
|
|
7066
7169
|
get: function () {
|
|
7067
|
-
return this.
|
|
7170
|
+
return this._displayTitle;
|
|
7068
7171
|
},
|
|
7172
|
+
/**
|
|
7173
|
+
* A flag specifying whether the window’s title bar should display the document title taken
|
|
7174
|
+
* from the Title entry of the document information dictionary. If false, the title bar
|
|
7175
|
+
* should instead display the name of the PDF file containing the document.
|
|
7176
|
+
* ```typescript
|
|
7177
|
+
* // Create a new PDF document
|
|
7178
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7179
|
+
* // Gets the viewer preferences of the document
|
|
7180
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7181
|
+
* // Sets the display title
|
|
7182
|
+
* viewerPreferences.displayTitle = true;
|
|
7183
|
+
* // Destroy the document
|
|
7184
|
+
* document.destroy();
|
|
7185
|
+
* ```
|
|
7186
|
+
*/
|
|
7069
7187
|
set: function (value) {
|
|
7070
|
-
this.
|
|
7188
|
+
this._displayTitle = value;
|
|
7189
|
+
this._dictionary.items.setValue(this._dictionaryProperties.displayTitle, new PdfBoolean(this._displayTitle));
|
|
7071
7190
|
},
|
|
7072
7191
|
enumerable: true,
|
|
7073
7192
|
configurable: true
|
|
7074
7193
|
});
|
|
7075
|
-
Object.defineProperty(
|
|
7194
|
+
Object.defineProperty(PdfViewerPreferences.prototype, "fitWindow", {
|
|
7076
7195
|
/**
|
|
7077
|
-
*
|
|
7078
|
-
*
|
|
7196
|
+
* A flag specifying whether to resize the document’s window to fit the size of the first
|
|
7197
|
+
* displayed page.
|
|
7198
|
+
* ```typescript
|
|
7199
|
+
* // Create a new PDF document
|
|
7200
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7201
|
+
* // Gets the viewer preferences of the document
|
|
7202
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7203
|
+
* // Gets the fit window
|
|
7204
|
+
* let fitWindow : boolean = viewerPreferences.fitWindow;
|
|
7205
|
+
* // Destroy the document
|
|
7206
|
+
* document.destroy();
|
|
7207
|
+
* ```
|
|
7079
7208
|
*/
|
|
7080
7209
|
get: function () {
|
|
7081
|
-
|
|
7082
|
-
|
|
7210
|
+
return this._fitWindow;
|
|
7211
|
+
},
|
|
7212
|
+
/**
|
|
7213
|
+
* A flag specifying whether to resize the document’s window to fit the size of the first
|
|
7214
|
+
* displayed page.
|
|
7215
|
+
* ```typescript
|
|
7216
|
+
* // Create a new PDF document
|
|
7217
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7218
|
+
* // Gets the viewer preferences of the document
|
|
7219
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7220
|
+
* // Sets the fit window
|
|
7221
|
+
* viewerPreferences.fitWindow = true;
|
|
7222
|
+
* // Destroy the document
|
|
7223
|
+
* document.destroy();
|
|
7224
|
+
* ```
|
|
7225
|
+
*/
|
|
7226
|
+
set: function (value) {
|
|
7227
|
+
this._fitWindow = value;
|
|
7228
|
+
this._dictionary.items.setValue(this._dictionaryProperties.fitWindow, new PdfBoolean(this._fitWindow));
|
|
7083
7229
|
},
|
|
7084
7230
|
enumerable: true,
|
|
7085
7231
|
configurable: true
|
|
7086
7232
|
});
|
|
7087
|
-
|
|
7233
|
+
Object.defineProperty(PdfViewerPreferences.prototype, "hideMenuBar", {
|
|
7234
|
+
/**
|
|
7235
|
+
* A flag specifying whether to hide the viewer application’s menu bar when the
|
|
7236
|
+
* document is active.
|
|
7237
|
+
* ```typescript
|
|
7238
|
+
* // Create a new PDF document
|
|
7239
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7240
|
+
* // Gets the viewer preferences of the document
|
|
7241
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7242
|
+
* // Gets the hide menu bar
|
|
7243
|
+
* let hideMenuBar: boolean = viewerPreferences.hideMenuBar;
|
|
7244
|
+
* // Destroy the document
|
|
7245
|
+
* document.destroy();
|
|
7246
|
+
* ```
|
|
7247
|
+
*/
|
|
7248
|
+
get: function () {
|
|
7249
|
+
return this._hideMenuBar;
|
|
7250
|
+
},
|
|
7251
|
+
/**
|
|
7252
|
+
* A flag specifying whether to hide the viewer application’s menu bar when the
|
|
7253
|
+
* document is active.
|
|
7254
|
+
* ```typescript
|
|
7255
|
+
* // Create a new PDF document
|
|
7256
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7257
|
+
* // Gets the viewer preferences of the document
|
|
7258
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7259
|
+
* // Sets the hide menu bar
|
|
7260
|
+
* viewerPreferences.hideMenuBar = true;
|
|
7261
|
+
* // Destroy the document
|
|
7262
|
+
* document.destroy();
|
|
7263
|
+
* ```
|
|
7264
|
+
*/
|
|
7265
|
+
set: function (value) {
|
|
7266
|
+
this._hideMenuBar = value;
|
|
7267
|
+
this._dictionary.items.setValue(this._dictionaryProperties.hideMenuBar, new PdfBoolean(this._hideMenuBar));
|
|
7268
|
+
},
|
|
7269
|
+
enumerable: true,
|
|
7270
|
+
configurable: true
|
|
7271
|
+
});
|
|
7272
|
+
Object.defineProperty(PdfViewerPreferences.prototype, "hideToolBar", {
|
|
7273
|
+
/**
|
|
7274
|
+
* A flag specifying whether to hide the viewer application’s tool bar when the
|
|
7275
|
+
* document is active.
|
|
7276
|
+
* ```typescript
|
|
7277
|
+
* // Create a new PDF document
|
|
7278
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7279
|
+
* // Gets the viewer preferences of the document
|
|
7280
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7281
|
+
* // Gets the hide tool bar
|
|
7282
|
+
* let hideToolBar: boolean = viewerPreferences.hideToolBar;
|
|
7283
|
+
* // Destroy the document
|
|
7284
|
+
* document.destroy();
|
|
7285
|
+
* ```
|
|
7286
|
+
*/
|
|
7287
|
+
get: function () {
|
|
7288
|
+
return this._hideToolBar;
|
|
7289
|
+
},
|
|
7290
|
+
/**
|
|
7291
|
+
* A flag specifying whether to hide the viewer application’s tool bar when the
|
|
7292
|
+
* document is active.
|
|
7293
|
+
* ```typescript
|
|
7294
|
+
* // Create a new PDF document
|
|
7295
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7296
|
+
* // Gets the viewer preferences of the document
|
|
7297
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7298
|
+
* // Sets the hide tool bar
|
|
7299
|
+
* viewerPreferences.hideToolbar = true;
|
|
7300
|
+
* // Destroy the document
|
|
7301
|
+
* document.destroy();
|
|
7302
|
+
* ```
|
|
7303
|
+
*/
|
|
7304
|
+
set: function (value) {
|
|
7305
|
+
this._hideToolBar = value;
|
|
7306
|
+
this._dictionary.items.setValue(this._dictionaryProperties.hideToolBar, new PdfBoolean(this._hideToolBar));
|
|
7307
|
+
},
|
|
7308
|
+
enumerable: true,
|
|
7309
|
+
configurable: true
|
|
7310
|
+
});
|
|
7311
|
+
Object.defineProperty(PdfViewerPreferences.prototype, "hideWindowUI", {
|
|
7312
|
+
/**
|
|
7313
|
+
* A flag specifying whether to hide user interface elements in the document’s window
|
|
7314
|
+
* (such as scroll bars and navigation controls), leaving only the document’s contents displayed.
|
|
7315
|
+
* ```typescript
|
|
7316
|
+
* // Create a new PDF document
|
|
7317
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7318
|
+
* // Gets the viewer preferences of the document
|
|
7319
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7320
|
+
* // Gets the hide window UI
|
|
7321
|
+
* let hideWindowUI: boolean = viewerPreferences.hideWindowUI;
|
|
7322
|
+
* // Destroy the document
|
|
7323
|
+
* document.destroy();
|
|
7324
|
+
* ```
|
|
7325
|
+
*/
|
|
7326
|
+
get: function () {
|
|
7327
|
+
return this._hideWindowUI;
|
|
7328
|
+
},
|
|
7329
|
+
/**
|
|
7330
|
+
* A flag specifying whether to hide user interface elements in the document’s window
|
|
7331
|
+
* (such as scroll bars and navigation controls), leaving only the document’s contents displayed.
|
|
7332
|
+
* ```typescript
|
|
7333
|
+
* // Create a new PDF document
|
|
7334
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7335
|
+
* // Gets the viewer preferences of the document
|
|
7336
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7337
|
+
* // Sets the hide window UI
|
|
7338
|
+
* viewerPreferences.hideWindowUI = true;
|
|
7339
|
+
* // Destroy the document
|
|
7340
|
+
* document.destroy();
|
|
7341
|
+
* ```
|
|
7342
|
+
*/
|
|
7343
|
+
set: function (value) {
|
|
7344
|
+
this._hideWindowUI = value;
|
|
7345
|
+
this._dictionary.items.setValue(this._dictionaryProperties.hideWindowUI, new PdfBoolean(this._hideWindowUI));
|
|
7346
|
+
},
|
|
7347
|
+
enumerable: true,
|
|
7348
|
+
configurable: true
|
|
7349
|
+
});
|
|
7350
|
+
Object.defineProperty(PdfViewerPreferences.prototype, "pageMode", {
|
|
7351
|
+
/**
|
|
7352
|
+
* A name object specifying how the document should be displayed when opened.
|
|
7353
|
+
* ```typescript
|
|
7354
|
+
* // Create a new PDF document
|
|
7355
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7356
|
+
* // Gets the viewer preferences of the document
|
|
7357
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7358
|
+
* // Gets the page mode
|
|
7359
|
+
* let pageMode: PdfPageMode = viewerPreferences.pageMode;
|
|
7360
|
+
* // Destroy the document
|
|
7361
|
+
* document.destroy();
|
|
7362
|
+
* ```
|
|
7363
|
+
*/
|
|
7364
|
+
get: function () {
|
|
7365
|
+
return this._pageMode;
|
|
7366
|
+
},
|
|
7367
|
+
/**
|
|
7368
|
+
* A name object specifying how the document should be displayed when opened.
|
|
7369
|
+
* ```typescript
|
|
7370
|
+
* // Create a new PDF document
|
|
7371
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7372
|
+
* // Gets the viewer preferences of the document
|
|
7373
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7374
|
+
* // Sets the page mode
|
|
7375
|
+
* viewerPreferences.pageMode = PdfPageMode.UseOutlines;
|
|
7376
|
+
* // Destroy the document
|
|
7377
|
+
* document.destroy();
|
|
7378
|
+
* ```
|
|
7379
|
+
*/
|
|
7380
|
+
set: function (value) {
|
|
7381
|
+
this._pageMode = value;
|
|
7382
|
+
this._catalog.items.setValue(this._dictionaryProperties.pageMode, new PdfName(this._mapPageMode(this._pageMode)));
|
|
7383
|
+
},
|
|
7384
|
+
enumerable: true,
|
|
7385
|
+
configurable: true
|
|
7386
|
+
});
|
|
7387
|
+
Object.defineProperty(PdfViewerPreferences.prototype, "duplex", {
|
|
7388
|
+
/**
|
|
7389
|
+
* Gets print duplex mode handling option to use when printing the file from the print dialog.
|
|
7390
|
+
* ```typescript
|
|
7391
|
+
* // Create a new PDF document
|
|
7392
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7393
|
+
* // Gets the viewer preferences of the document
|
|
7394
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7395
|
+
* // Gets the duplex
|
|
7396
|
+
* let duplex : DuplexMode = viewerPreferences.duplex;
|
|
7397
|
+
* // Destroy the document
|
|
7398
|
+
* document.destroy();
|
|
7399
|
+
* ```
|
|
7400
|
+
*/
|
|
7401
|
+
get: function () {
|
|
7402
|
+
return this._duplex;
|
|
7403
|
+
},
|
|
7404
|
+
/**
|
|
7405
|
+
* Sets print duplex mode handling option to use when printing the file from the print dialog.
|
|
7406
|
+
* ```typescript
|
|
7407
|
+
* // Create a new PDF document
|
|
7408
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7409
|
+
* // Gets the viewer preferences of the document
|
|
7410
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7411
|
+
* // Sets the duplex
|
|
7412
|
+
* viewerPreferences.duplex = DuplexMode.DuplexFlipLongEdge;
|
|
7413
|
+
* // Destroy the document
|
|
7414
|
+
* document.destroy();
|
|
7415
|
+
* ```
|
|
7416
|
+
*/
|
|
7417
|
+
set: function (value) {
|
|
7418
|
+
this._duplex = value;
|
|
7419
|
+
this._catalog.items.setValue(this._dictionaryProperties.duplex, new PdfName(this._mapDuplexMode(this._duplex)));
|
|
7420
|
+
},
|
|
7421
|
+
enumerable: true,
|
|
7422
|
+
configurable: true
|
|
7423
|
+
});
|
|
7424
|
+
Object.defineProperty(PdfViewerPreferences.prototype, "pageLayout", {
|
|
7425
|
+
/**
|
|
7426
|
+
* A name object specifying the page layout to be used when the document is opened.
|
|
7427
|
+
* ```typescript
|
|
7428
|
+
* // Create a new PDF document
|
|
7429
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7430
|
+
* // Gets the viewer preferences of the document
|
|
7431
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7432
|
+
* // Gets the page layout
|
|
7433
|
+
* let pageLayout : PdfPageLayout = viewerPreferences.pageLayout;
|
|
7434
|
+
* // Destroy the document
|
|
7435
|
+
* document.destroy();
|
|
7436
|
+
* ```
|
|
7437
|
+
*/
|
|
7438
|
+
get: function () {
|
|
7439
|
+
return this._pageLayout;
|
|
7440
|
+
},
|
|
7441
|
+
/**
|
|
7442
|
+
* A name object specifying the page layout to be used when the document is opened.
|
|
7443
|
+
* ```typescript
|
|
7444
|
+
* // Create a new PDF document
|
|
7445
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7446
|
+
* // Gets the viewer preferences of the document
|
|
7447
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7448
|
+
* // Sets the page layout
|
|
7449
|
+
* viewerPreferences.pageLayout = PdfPageLayout.TwoColumnLeft;
|
|
7450
|
+
* // Destroy the document
|
|
7451
|
+
* document.destroy();
|
|
7452
|
+
* ```
|
|
7453
|
+
*/
|
|
7454
|
+
set: function (value) {
|
|
7455
|
+
this._pageLayout = value;
|
|
7456
|
+
this._catalog.items.setValue(this._dictionaryProperties.pageLayout, new PdfName(this._mapPageLayout(this._pageLayout)));
|
|
7457
|
+
},
|
|
7458
|
+
enumerable: true,
|
|
7459
|
+
configurable: true
|
|
7460
|
+
});
|
|
7461
|
+
Object.defineProperty(PdfViewerPreferences.prototype, "pageScaling", {
|
|
7462
|
+
/**
|
|
7463
|
+
* Gets the page scaling option to be selected
|
|
7464
|
+
* when a print dialog is displayed for this document.
|
|
7465
|
+
* ```typescript
|
|
7466
|
+
* // Create a new PDF document
|
|
7467
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7468
|
+
* // Gets the viewer preferences of the document
|
|
7469
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7470
|
+
* // Gets the page scaling
|
|
7471
|
+
* let pageScaling : PageScalingMode = viewerPreferences.pageScaling;
|
|
7472
|
+
* // Destroy the document
|
|
7473
|
+
* document.destroy();
|
|
7474
|
+
* ```
|
|
7475
|
+
*/
|
|
7476
|
+
get: function () {
|
|
7477
|
+
return this._pageScaling;
|
|
7478
|
+
},
|
|
7479
|
+
/**
|
|
7480
|
+
* Sets the page scaling option to be selected
|
|
7481
|
+
* when a print dialog is displayed for this document.
|
|
7482
|
+
* ```typescript
|
|
7483
|
+
* // Create a new PDF document
|
|
7484
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7485
|
+
* // Gets the viewer preferences of the document
|
|
7486
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7487
|
+
* // Sets the page scaling
|
|
7488
|
+
* viewerPreferences.pageScaling = PageScalingMode.None;
|
|
7489
|
+
* // Destroy the document
|
|
7490
|
+
* document.destroy();
|
|
7491
|
+
* ```
|
|
7492
|
+
*/
|
|
7493
|
+
set: function (value) {
|
|
7494
|
+
this._pageScaling = value;
|
|
7495
|
+
if (this._pageScaling === PageScalingMode.AppDefault && this._dictionary.items.containsKey(this._dictionaryProperties.printScaling)) {
|
|
7496
|
+
this._dictionary.items.remove(this._dictionaryProperties.printScaling);
|
|
7497
|
+
}
|
|
7498
|
+
else {
|
|
7499
|
+
this._dictionary.items.setValue(this._dictionaryProperties.printScaling, new PdfName('None'));
|
|
7500
|
+
}
|
|
7501
|
+
},
|
|
7502
|
+
enumerable: true,
|
|
7503
|
+
configurable: true
|
|
7504
|
+
});
|
|
7505
|
+
Object.defineProperty(PdfViewerPreferences.prototype, "element", {
|
|
7506
|
+
/**
|
|
7507
|
+
* Primivie element
|
|
7508
|
+
*
|
|
7509
|
+
* @private
|
|
7510
|
+
*/
|
|
7511
|
+
get: function () {
|
|
7512
|
+
return this._dictionary;
|
|
7513
|
+
},
|
|
7514
|
+
enumerable: true,
|
|
7515
|
+
configurable: true
|
|
7516
|
+
});
|
|
7517
|
+
PdfViewerPreferences.prototype._mapDuplexMode = function (mode) {
|
|
7518
|
+
switch (mode) {
|
|
7519
|
+
case DuplexMode.Simplex:
|
|
7520
|
+
return 'Simplex';
|
|
7521
|
+
case DuplexMode.DuplexFlipShortEdge:
|
|
7522
|
+
return 'DuplexFlipShortEdge';
|
|
7523
|
+
case DuplexMode.DuplexFlipLongEdge:
|
|
7524
|
+
return 'DuplexFlipLongEdge';
|
|
7525
|
+
case DuplexMode.None:
|
|
7526
|
+
return 'None';
|
|
7527
|
+
}
|
|
7528
|
+
};
|
|
7529
|
+
PdfViewerPreferences.prototype._mapPageMode = function (mode) {
|
|
7530
|
+
switch (mode) {
|
|
7531
|
+
case PdfPageMode.UseNone:
|
|
7532
|
+
return 'UseNone';
|
|
7533
|
+
case PdfPageMode.UseOutlines:
|
|
7534
|
+
return 'UseOutlines';
|
|
7535
|
+
case PdfPageMode.UseThumbs:
|
|
7536
|
+
return 'UseThumbs';
|
|
7537
|
+
case PdfPageMode.FullScreen:
|
|
7538
|
+
return 'FullScreen';
|
|
7539
|
+
case PdfPageMode.UseOC:
|
|
7540
|
+
return 'UseOC';
|
|
7541
|
+
case PdfPageMode.UseAttachments:
|
|
7542
|
+
return 'UseAttachments';
|
|
7543
|
+
}
|
|
7544
|
+
};
|
|
7545
|
+
PdfViewerPreferences.prototype._mapPageLayout = function (layout) {
|
|
7546
|
+
switch (layout) {
|
|
7547
|
+
case PdfPageLayout.SinglePage:
|
|
7548
|
+
return 'SinglePage';
|
|
7549
|
+
case PdfPageLayout.OneColumn:
|
|
7550
|
+
return 'OneColumn';
|
|
7551
|
+
case PdfPageLayout.TwoColumnLeft:
|
|
7552
|
+
return 'TwoColumnLeft';
|
|
7553
|
+
case PdfPageLayout.TwoColumnRight:
|
|
7554
|
+
return 'TwoColumnRight';
|
|
7555
|
+
case PdfPageLayout.TwoPageLeft:
|
|
7556
|
+
return 'TwoPageLeft';
|
|
7557
|
+
case PdfPageLayout.TwoPageRight:
|
|
7558
|
+
return 'TwoPageRight';
|
|
7559
|
+
}
|
|
7560
|
+
};
|
|
7561
|
+
return PdfViewerPreferences;
|
|
7562
|
+
}());
|
|
7563
|
+
/**
|
|
7564
|
+
* Represents mode of document displaying.
|
|
7565
|
+
* ```typescript
|
|
7566
|
+
* // Create a new PDF document
|
|
7567
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7568
|
+
* // Gets the viewer preferences of the document
|
|
7569
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7570
|
+
* // Sets the page mode
|
|
7571
|
+
* viewerPreferences.pageMode = PdfPageMode.UseOutlines;
|
|
7572
|
+
* // Destroy the document
|
|
7573
|
+
* document.destroy();
|
|
7574
|
+
* ```
|
|
7575
|
+
*/
|
|
7576
|
+
var PdfPageMode;
|
|
7577
|
+
(function (PdfPageMode) {
|
|
7578
|
+
/**
|
|
7579
|
+
* Default value. Neither document outline nor thumbnail images visible.
|
|
7580
|
+
*/
|
|
7581
|
+
PdfPageMode[PdfPageMode["UseNone"] = 0] = "UseNone";
|
|
7582
|
+
/**
|
|
7583
|
+
* Document outline visible.
|
|
7584
|
+
*/
|
|
7585
|
+
PdfPageMode[PdfPageMode["UseOutlines"] = 1] = "UseOutlines";
|
|
7586
|
+
/**
|
|
7587
|
+
* Thumbnail images visible.
|
|
7588
|
+
*/
|
|
7589
|
+
PdfPageMode[PdfPageMode["UseThumbs"] = 2] = "UseThumbs";
|
|
7590
|
+
/**
|
|
7591
|
+
* Full-screen mode, with no menu bar, window controls, or any other window visible.
|
|
7592
|
+
*/
|
|
7593
|
+
PdfPageMode[PdfPageMode["FullScreen"] = 3] = "FullScreen";
|
|
7594
|
+
/**
|
|
7595
|
+
* Optional content group panel visible.
|
|
7596
|
+
*/
|
|
7597
|
+
PdfPageMode[PdfPageMode["UseOC"] = 4] = "UseOC";
|
|
7598
|
+
/**
|
|
7599
|
+
* Attachments are visible.
|
|
7600
|
+
*/
|
|
7601
|
+
PdfPageMode[PdfPageMode["UseAttachments"] = 5] = "UseAttachments";
|
|
7602
|
+
})(PdfPageMode || (PdfPageMode = {}));
|
|
7603
|
+
/**
|
|
7604
|
+
* A name object specifying the page layout to be used when the document is opened.
|
|
7605
|
+
* ```typescript
|
|
7606
|
+
* // Create a new PDF document
|
|
7607
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7608
|
+
* // Gets the viewer preferences of the document
|
|
7609
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7610
|
+
* // Sets the page layout
|
|
7611
|
+
* viewerPreferences.pageLayout = PdfPageLayout.TwoColumnLeft;
|
|
7612
|
+
* // Destroy the document
|
|
7613
|
+
* document.destroy();
|
|
7614
|
+
* ```
|
|
7615
|
+
*/
|
|
7616
|
+
var PdfPageLayout;
|
|
7617
|
+
(function (PdfPageLayout) {
|
|
7618
|
+
/**
|
|
7619
|
+
* Default Value. Display one page at a time.
|
|
7620
|
+
*/
|
|
7621
|
+
PdfPageLayout[PdfPageLayout["SinglePage"] = 0] = "SinglePage";
|
|
7622
|
+
/**
|
|
7623
|
+
* Display the pages in one column.
|
|
7624
|
+
*/
|
|
7625
|
+
PdfPageLayout[PdfPageLayout["OneColumn"] = 1] = "OneColumn";
|
|
7626
|
+
/**
|
|
7627
|
+
* Display the pages in two columns, with odd numbered
|
|
7628
|
+
* pages on the left.
|
|
7629
|
+
*/
|
|
7630
|
+
PdfPageLayout[PdfPageLayout["TwoColumnLeft"] = 2] = "TwoColumnLeft";
|
|
7631
|
+
/**
|
|
7632
|
+
* Display the pages in two columns, with odd numbered
|
|
7633
|
+
* pages on the right.
|
|
7634
|
+
*/
|
|
7635
|
+
PdfPageLayout[PdfPageLayout["TwoColumnRight"] = 3] = "TwoColumnRight";
|
|
7636
|
+
/**
|
|
7637
|
+
* Display the pages two at a time, with odd-numbered pages on the left.
|
|
7638
|
+
*/
|
|
7639
|
+
PdfPageLayout[PdfPageLayout["TwoPageLeft"] = 4] = "TwoPageLeft";
|
|
7640
|
+
/**
|
|
7641
|
+
* Display the pages two at a time, with odd-numbered pages on the right.
|
|
7642
|
+
*/
|
|
7643
|
+
PdfPageLayout[PdfPageLayout["TwoPageRight"] = 5] = "TwoPageRight";
|
|
7644
|
+
})(PdfPageLayout || (PdfPageLayout = {}));
|
|
7645
|
+
/**
|
|
7646
|
+
* The paper handling option to use when printing the file from the print dialog.
|
|
7647
|
+
* ```typescript
|
|
7648
|
+
* // Create a new PDF document
|
|
7649
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7650
|
+
* // Gets the viewer preferences of the document
|
|
7651
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7652
|
+
* // Sets the duplex
|
|
7653
|
+
* viewerPreferences.duplex = DuplexMode.DuplexFlipLongEdge;
|
|
7654
|
+
* // Destroy the document
|
|
7655
|
+
* document.destroy();
|
|
7656
|
+
* ```
|
|
7657
|
+
*/
|
|
7658
|
+
var DuplexMode;
|
|
7659
|
+
(function (DuplexMode) {
|
|
7660
|
+
/**
|
|
7661
|
+
* Print single-sided.
|
|
7662
|
+
*/
|
|
7663
|
+
DuplexMode[DuplexMode["Simplex"] = 0] = "Simplex";
|
|
7664
|
+
/**
|
|
7665
|
+
* Duplex and flip on the short edge of the sheet.
|
|
7666
|
+
*/
|
|
7667
|
+
DuplexMode[DuplexMode["DuplexFlipShortEdge"] = 1] = "DuplexFlipShortEdge";
|
|
7668
|
+
/**
|
|
7669
|
+
* Duplex and flip on the long edge of the sheet.
|
|
7670
|
+
*/
|
|
7671
|
+
DuplexMode[DuplexMode["DuplexFlipLongEdge"] = 2] = "DuplexFlipLongEdge";
|
|
7672
|
+
/**
|
|
7673
|
+
* Default value.
|
|
7674
|
+
*/
|
|
7675
|
+
DuplexMode[DuplexMode["None"] = 3] = "None";
|
|
7676
|
+
})(DuplexMode || (DuplexMode = {}));
|
|
7677
|
+
/**
|
|
7678
|
+
* Specifies the different page scaling option that shall be selected
|
|
7679
|
+
* when a print dialog is displayed for this document.
|
|
7680
|
+
* ```typescript
|
|
7681
|
+
* // Create a new PDF document
|
|
7682
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7683
|
+
* // Gets the viewer preferences of the document
|
|
7684
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7685
|
+
* // Sets the page scaling
|
|
7686
|
+
* viewerPreferences.pageScaling = PageScalingMode.None;
|
|
7687
|
+
* // Destroy the document
|
|
7688
|
+
* document.destroy();
|
|
7689
|
+
* ```
|
|
7690
|
+
*/
|
|
7691
|
+
var PageScalingMode;
|
|
7692
|
+
(function (PageScalingMode) {
|
|
7693
|
+
/**
|
|
7694
|
+
* Indicates the conforming reader’s default print scaling.
|
|
7695
|
+
*/
|
|
7696
|
+
PageScalingMode[PageScalingMode["AppDefault"] = 0] = "AppDefault";
|
|
7697
|
+
/**
|
|
7698
|
+
* Indicates no page scaling.
|
|
7699
|
+
*/
|
|
7700
|
+
PageScalingMode[PageScalingMode["None"] = 1] = "None";
|
|
7701
|
+
})(PageScalingMode || (PageScalingMode = {}));
|
|
7702
|
+
|
|
7703
|
+
var __extends$7 = (undefined && undefined.__extends) || (function () {
|
|
7704
|
+
var extendStatics = function (d, b) {
|
|
7705
|
+
extendStatics = Object.setPrototypeOf ||
|
|
7706
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
7707
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7708
|
+
return extendStatics(d, b);
|
|
7709
|
+
};
|
|
7710
|
+
return function (d, b) {
|
|
7711
|
+
extendStatics(d, b);
|
|
7712
|
+
function __() { this.constructor = d; }
|
|
7713
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
7714
|
+
};
|
|
7715
|
+
})();
|
|
7716
|
+
/**
|
|
7717
|
+
* PdfCatalog.ts class for EJ2-PDF
|
|
7718
|
+
*/
|
|
7719
|
+
/**
|
|
7720
|
+
* `PdfCatalog` class represents internal catalog of the Pdf document.
|
|
7721
|
+
* @private
|
|
7722
|
+
*/
|
|
7723
|
+
var PdfCatalog = /** @__PURE__ @class */ (function (_super) {
|
|
7724
|
+
__extends$7(PdfCatalog, _super);
|
|
7725
|
+
//constructor
|
|
7726
|
+
/**
|
|
7727
|
+
* Initializes a new instance of the `PdfCatalog` class.
|
|
7728
|
+
* @private
|
|
7729
|
+
*/
|
|
7730
|
+
function PdfCatalog() {
|
|
7731
|
+
var _this = _super.call(this) || this;
|
|
7732
|
+
//fields
|
|
7733
|
+
/**
|
|
7734
|
+
* Internal variable to store collection of `sections`.
|
|
7735
|
+
* @default null
|
|
7736
|
+
* @private
|
|
7737
|
+
*/
|
|
7738
|
+
_this.sections = null;
|
|
7739
|
+
/**
|
|
7740
|
+
* Internal variable for accessing fields from `DictionryProperties` class.
|
|
7741
|
+
* @private
|
|
7742
|
+
*/
|
|
7743
|
+
_this.tempDictionaryProperties = new DictionaryProperties();
|
|
7744
|
+
_this.items.setValue(new DictionaryProperties().type, new PdfName('Catalog'));
|
|
7745
|
+
return _this;
|
|
7746
|
+
}
|
|
7747
|
+
Object.defineProperty(PdfCatalog.prototype, "pages", {
|
|
7748
|
+
//Properties
|
|
7749
|
+
/**
|
|
7750
|
+
* Gets or sets the sections, which contain `pages`.
|
|
7751
|
+
* @private
|
|
7752
|
+
*/
|
|
7753
|
+
get: function () {
|
|
7754
|
+
return this.sections;
|
|
7755
|
+
},
|
|
7756
|
+
set: function (value) {
|
|
7757
|
+
var dictionary = value.element;
|
|
7758
|
+
// if (this.sections !== value) {
|
|
7759
|
+
// this.sections = value;
|
|
7760
|
+
// this.Items.setValue(this.tempDictionaryProperties.pages, new PdfReferenceHolder(value));
|
|
7761
|
+
// }
|
|
7762
|
+
this.sections = value;
|
|
7763
|
+
this.items.setValue(this.tempDictionaryProperties.pages, new PdfReferenceHolder(value));
|
|
7764
|
+
},
|
|
7765
|
+
enumerable: true,
|
|
7766
|
+
configurable: true
|
|
7767
|
+
});
|
|
7768
|
+
Object.defineProperty(PdfCatalog.prototype, "viewerPreferences", {
|
|
7769
|
+
/**
|
|
7770
|
+
* Gets the viewer preferences of the PDF document.
|
|
7771
|
+
* @private
|
|
7772
|
+
*/
|
|
7773
|
+
get: function () {
|
|
7774
|
+
if (this._viewerPreferences === null || typeof this._viewerPreferences === 'undefined') {
|
|
7775
|
+
this._viewerPreferences = new PdfViewerPreferences(this);
|
|
7776
|
+
this.items.setValue(this.tempDictionaryProperties.viewerPreferences, new PdfReferenceHolder(this._viewerPreferences.element));
|
|
7777
|
+
}
|
|
7778
|
+
return this._viewerPreferences;
|
|
7779
|
+
},
|
|
7780
|
+
enumerable: true,
|
|
7781
|
+
configurable: true
|
|
7782
|
+
});
|
|
7783
|
+
return PdfCatalog;
|
|
7784
|
+
}(PdfDictionary));
|
|
7785
|
+
|
|
7786
|
+
/**
|
|
7787
|
+
* `PdfCrossTable` is responsible for intermediate level parsing
|
|
7788
|
+
* and savingof a PDF document.
|
|
7789
|
+
* @private
|
|
7790
|
+
*/
|
|
7791
|
+
var PdfCrossTable = /** @__PURE__ @class */ (function () {
|
|
7792
|
+
function PdfCrossTable() {
|
|
7793
|
+
/**
|
|
7794
|
+
* The modified `objects` that should be saved.
|
|
7795
|
+
* @private
|
|
7796
|
+
*/
|
|
7797
|
+
this.objects = new Dictionary();
|
|
7798
|
+
/**
|
|
7799
|
+
* Holds `maximal generation number` or offset to object.
|
|
7800
|
+
* @default 0
|
|
7801
|
+
* @private
|
|
7802
|
+
*/
|
|
7803
|
+
this.maxGenNumIndex = 0;
|
|
7804
|
+
/**
|
|
7805
|
+
* The `number of the objects`.
|
|
7806
|
+
* @default 0
|
|
7807
|
+
* @private
|
|
7808
|
+
*/
|
|
7809
|
+
this.objectCount = 0;
|
|
7810
|
+
/**
|
|
7811
|
+
* Internal variable for accessing fields from `DictionryProperties` class.
|
|
7812
|
+
* @default new PdfDictionaryProperties()
|
|
7813
|
+
* @private
|
|
7814
|
+
*/
|
|
7815
|
+
this.dictionaryProperties = new DictionaryProperties();
|
|
7816
|
+
}
|
|
7817
|
+
Object.defineProperty(PdfCrossTable.prototype, "isMerging", {
|
|
7818
|
+
//Properties
|
|
7819
|
+
/**
|
|
7820
|
+
* Gets or sets if the document `is merged`.
|
|
7821
|
+
* @private
|
|
7822
|
+
*/
|
|
7823
|
+
get: function () {
|
|
7824
|
+
return this.merging;
|
|
7825
|
+
},
|
|
7826
|
+
set: function (value) {
|
|
7827
|
+
this.merging = value;
|
|
7828
|
+
},
|
|
7829
|
+
enumerable: true,
|
|
7830
|
+
configurable: true
|
|
7831
|
+
});
|
|
7832
|
+
Object.defineProperty(PdfCrossTable.prototype, "trailer", {
|
|
7833
|
+
/**
|
|
7834
|
+
* Gets the `trailer`.
|
|
7835
|
+
* @private
|
|
7836
|
+
*/
|
|
7837
|
+
get: function () {
|
|
7838
|
+
if (this.internalTrailer == null) {
|
|
7839
|
+
this.internalTrailer = new PdfStream();
|
|
7840
|
+
}
|
|
7841
|
+
return this.internalTrailer;
|
|
7842
|
+
},
|
|
7843
|
+
enumerable: true,
|
|
7844
|
+
configurable: true
|
|
7845
|
+
});
|
|
7846
|
+
Object.defineProperty(PdfCrossTable.prototype, "document", {
|
|
7847
|
+
/**
|
|
7848
|
+
* Gets or sets the main `PdfDocument` class instance.
|
|
7849
|
+
* @private
|
|
7850
|
+
*/
|
|
7851
|
+
get: function () {
|
|
7852
|
+
return this.pdfDocument;
|
|
7853
|
+
},
|
|
7854
|
+
set: function (value) {
|
|
7855
|
+
this.pdfDocument = value;
|
|
7856
|
+
this.items = this.pdfDocument.pdfObjects;
|
|
7857
|
+
},
|
|
7858
|
+
enumerable: true,
|
|
7859
|
+
configurable: true
|
|
7860
|
+
});
|
|
7861
|
+
Object.defineProperty(PdfCrossTable.prototype, "pdfObjects", {
|
|
7862
|
+
/**
|
|
7863
|
+
* Gets the catched `PDF object` main collection.
|
|
7864
|
+
* @private
|
|
7865
|
+
*/
|
|
7866
|
+
get: function () {
|
|
7867
|
+
return this.items;
|
|
7868
|
+
},
|
|
7869
|
+
enumerable: true,
|
|
7870
|
+
configurable: true
|
|
7871
|
+
});
|
|
7872
|
+
Object.defineProperty(PdfCrossTable.prototype, "objectCollection", {
|
|
7873
|
+
/**
|
|
7874
|
+
* Gets the `object collection`.
|
|
7875
|
+
* @private
|
|
7876
|
+
*/
|
|
7877
|
+
get: function () {
|
|
7878
|
+
return this.pdfDocument.pdfObjects;
|
|
7879
|
+
},
|
|
7880
|
+
enumerable: true,
|
|
7881
|
+
configurable: true
|
|
7882
|
+
});
|
|
7883
|
+
Object.defineProperty(PdfCrossTable.prototype, "count", {
|
|
7884
|
+
/**
|
|
7885
|
+
* Gets or sets the `number of the objects` within the document.
|
|
7886
|
+
* @private
|
|
7887
|
+
*/
|
|
7888
|
+
get: function () {
|
|
7889
|
+
return this.objectCount;
|
|
7890
|
+
},
|
|
7891
|
+
set: function (value) {
|
|
7892
|
+
this.objectCount = value;
|
|
7893
|
+
},
|
|
7894
|
+
enumerable: true,
|
|
7895
|
+
configurable: true
|
|
7896
|
+
});
|
|
7897
|
+
Object.defineProperty(PdfCrossTable.prototype, "nextObjNumber", {
|
|
7898
|
+
/**
|
|
7899
|
+
* Returns `next available object number`.
|
|
7900
|
+
* @private
|
|
7901
|
+
*/
|
|
7902
|
+
get: function () {
|
|
7903
|
+
this.count = this.count + 1;
|
|
7904
|
+
return this.count;
|
|
7905
|
+
},
|
|
7906
|
+
enumerable: true,
|
|
7907
|
+
configurable: true
|
|
7908
|
+
});
|
|
7909
|
+
PdfCrossTable.prototype.save = function (writer, filename) {
|
|
7088
7910
|
this.saveHead(writer);
|
|
7089
7911
|
this.mappedReferences = null;
|
|
7090
7912
|
this.objects.clear();
|
|
@@ -9976,120 +10798,6 @@ var ByteArray = /** @__PURE__ @class */ (function () {
|
|
|
9976
10798
|
return ByteArray;
|
|
9977
10799
|
}());
|
|
9978
10800
|
|
|
9979
|
-
/**
|
|
9980
|
-
* `PdfBoolean` class is used to perform boolean related primitive operations.
|
|
9981
|
-
* @private
|
|
9982
|
-
*/
|
|
9983
|
-
var PdfBoolean = /** @__PURE__ @class */ (function () {
|
|
9984
|
-
//constructor
|
|
9985
|
-
/**
|
|
9986
|
-
* Initializes a new instance of the `PdfBoolean` class.
|
|
9987
|
-
* @private
|
|
9988
|
-
*/
|
|
9989
|
-
function PdfBoolean(value) {
|
|
9990
|
-
/**
|
|
9991
|
-
* Internal variable to store the `position`.
|
|
9992
|
-
* @default -1
|
|
9993
|
-
* @private
|
|
9994
|
-
*/
|
|
9995
|
-
this.currentPosition = -1;
|
|
9996
|
-
this.value = value;
|
|
9997
|
-
}
|
|
9998
|
-
Object.defineProperty(PdfBoolean.prototype, "status", {
|
|
9999
|
-
//Properties
|
|
10000
|
-
/**
|
|
10001
|
-
* Gets or sets the `Status` of the specified object.
|
|
10002
|
-
* @private
|
|
10003
|
-
*/
|
|
10004
|
-
get: function () {
|
|
10005
|
-
return this.objectStatus;
|
|
10006
|
-
},
|
|
10007
|
-
set: function (value) {
|
|
10008
|
-
this.objectStatus = value;
|
|
10009
|
-
},
|
|
10010
|
-
enumerable: true,
|
|
10011
|
-
configurable: true
|
|
10012
|
-
});
|
|
10013
|
-
Object.defineProperty(PdfBoolean.prototype, "isSaving", {
|
|
10014
|
-
/**
|
|
10015
|
-
* Gets or sets a value indicating whether this document `is saving` or not.
|
|
10016
|
-
* @private
|
|
10017
|
-
*/
|
|
10018
|
-
get: function () {
|
|
10019
|
-
return this.saving;
|
|
10020
|
-
},
|
|
10021
|
-
set: function (value) {
|
|
10022
|
-
this.saving = value;
|
|
10023
|
-
},
|
|
10024
|
-
enumerable: true,
|
|
10025
|
-
configurable: true
|
|
10026
|
-
});
|
|
10027
|
-
Object.defineProperty(PdfBoolean.prototype, "objectCollectionIndex", {
|
|
10028
|
-
/**
|
|
10029
|
-
* Gets or sets the `index` value of the specified object.
|
|
10030
|
-
* @private
|
|
10031
|
-
*/
|
|
10032
|
-
get: function () {
|
|
10033
|
-
return this.index;
|
|
10034
|
-
},
|
|
10035
|
-
set: function (value) {
|
|
10036
|
-
this.index = value;
|
|
10037
|
-
},
|
|
10038
|
-
enumerable: true,
|
|
10039
|
-
configurable: true
|
|
10040
|
-
});
|
|
10041
|
-
Object.defineProperty(PdfBoolean.prototype, "position", {
|
|
10042
|
-
/**
|
|
10043
|
-
* Gets or sets the `position` of the object.
|
|
10044
|
-
* @private
|
|
10045
|
-
*/
|
|
10046
|
-
get: function () {
|
|
10047
|
-
return this.currentPosition;
|
|
10048
|
-
},
|
|
10049
|
-
set: function (value) {
|
|
10050
|
-
this.currentPosition = value;
|
|
10051
|
-
},
|
|
10052
|
-
enumerable: true,
|
|
10053
|
-
configurable: true
|
|
10054
|
-
});
|
|
10055
|
-
Object.defineProperty(PdfBoolean.prototype, "clonedObject", {
|
|
10056
|
-
/**
|
|
10057
|
-
* Returns `cloned object`.
|
|
10058
|
-
* @private
|
|
10059
|
-
*/
|
|
10060
|
-
get: function () {
|
|
10061
|
-
var rValue = null;
|
|
10062
|
-
return rValue;
|
|
10063
|
-
},
|
|
10064
|
-
enumerable: true,
|
|
10065
|
-
configurable: true
|
|
10066
|
-
});
|
|
10067
|
-
/**
|
|
10068
|
-
* `Saves` the object using the specified writer.
|
|
10069
|
-
* @private
|
|
10070
|
-
*/
|
|
10071
|
-
PdfBoolean.prototype.save = function (writer) {
|
|
10072
|
-
writer.write(this.boolToStr(this.value));
|
|
10073
|
-
};
|
|
10074
|
-
/**
|
|
10075
|
-
* Creates a `copy of PdfBoolean`.
|
|
10076
|
-
* @private
|
|
10077
|
-
*/
|
|
10078
|
-
PdfBoolean.prototype.clone = function (crossTable) {
|
|
10079
|
-
var newNumber = new PdfBoolean(this.value);
|
|
10080
|
-
return newNumber;
|
|
10081
|
-
};
|
|
10082
|
-
// Implementation
|
|
10083
|
-
/**
|
|
10084
|
-
* Converts `boolean to string` - 0/1 'true'/'false'.
|
|
10085
|
-
* @private
|
|
10086
|
-
*/
|
|
10087
|
-
PdfBoolean.prototype.boolToStr = function (value) {
|
|
10088
|
-
return value ? 'true' : 'false';
|
|
10089
|
-
};
|
|
10090
|
-
return PdfBoolean;
|
|
10091
|
-
}());
|
|
10092
|
-
|
|
10093
10801
|
/**
|
|
10094
10802
|
* ImageDecoder class
|
|
10095
10803
|
*/
|