@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
|
@@ -1211,6 +1211,61 @@ class DictionaryProperties {
|
|
|
1211
1211
|
* @private
|
|
1212
1212
|
*/
|
|
1213
1213
|
this.yStep = 'YStep';
|
|
1214
|
+
/**
|
|
1215
|
+
* Specifies the value of viewer preferences.
|
|
1216
|
+
* @private
|
|
1217
|
+
*/
|
|
1218
|
+
this.viewerPreferences = 'ViewerPreferences';
|
|
1219
|
+
/**
|
|
1220
|
+
* Specifies the value of center window.
|
|
1221
|
+
* @private
|
|
1222
|
+
*/
|
|
1223
|
+
this.centerWindow = 'CenterWindow';
|
|
1224
|
+
/**
|
|
1225
|
+
* Specifies the value of display title.
|
|
1226
|
+
* @private
|
|
1227
|
+
*/
|
|
1228
|
+
this.displayTitle = 'DisplayTitle';
|
|
1229
|
+
/**
|
|
1230
|
+
* Specifies the value of fit window.
|
|
1231
|
+
* @private
|
|
1232
|
+
*/
|
|
1233
|
+
this.fitWindow = 'FitWindow';
|
|
1234
|
+
/**
|
|
1235
|
+
* Specifies the value of hide menu bar.
|
|
1236
|
+
* @private
|
|
1237
|
+
*/
|
|
1238
|
+
this.hideMenuBar = 'HideMenubar';
|
|
1239
|
+
/**
|
|
1240
|
+
* Specifies the value of hide tool bar.
|
|
1241
|
+
* @private
|
|
1242
|
+
*/
|
|
1243
|
+
this.hideToolBar = 'HideToolbar';
|
|
1244
|
+
/**
|
|
1245
|
+
* Specifies the value of hide window UI.
|
|
1246
|
+
* @private
|
|
1247
|
+
*/
|
|
1248
|
+
this.hideWindowUI = 'HideWindowUI';
|
|
1249
|
+
/**
|
|
1250
|
+
* Specifies the value of page mode.
|
|
1251
|
+
* @private
|
|
1252
|
+
*/
|
|
1253
|
+
this.pageMode = 'PageMode';
|
|
1254
|
+
/**
|
|
1255
|
+
* Specifies the value of page layout.
|
|
1256
|
+
* @private
|
|
1257
|
+
*/
|
|
1258
|
+
this.pageLayout = 'PageLayout';
|
|
1259
|
+
/**
|
|
1260
|
+
* Specifies the value of duplex.
|
|
1261
|
+
* @private
|
|
1262
|
+
*/
|
|
1263
|
+
this.duplex = 'Duplex';
|
|
1264
|
+
/**
|
|
1265
|
+
* Specifies the value of print scaling.
|
|
1266
|
+
* @private
|
|
1267
|
+
*/
|
|
1268
|
+
this.printScaling = 'PrintScaling';
|
|
1214
1269
|
//
|
|
1215
1270
|
}
|
|
1216
1271
|
}
|
|
@@ -6213,6 +6268,20 @@ class PdfDocumentBase {
|
|
|
6213
6268
|
set catalog(value) {
|
|
6214
6269
|
this.pdfCatalog = value;
|
|
6215
6270
|
}
|
|
6271
|
+
/**
|
|
6272
|
+
* Gets viewer preferences for presenting the PDF document in a viewer.
|
|
6273
|
+
* ```typescript
|
|
6274
|
+
* // Create a new PDF document
|
|
6275
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6276
|
+
* // Gets viewer preferences
|
|
6277
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6278
|
+
* // Destroy the document
|
|
6279
|
+
* document.destroy();
|
|
6280
|
+
* ```
|
|
6281
|
+
*/
|
|
6282
|
+
get viewerPreferences() {
|
|
6283
|
+
return this.pdfCatalog.viewerPreferences;
|
|
6284
|
+
}
|
|
6216
6285
|
//Public methods
|
|
6217
6286
|
/**
|
|
6218
6287
|
* Sets the `main object collection`.
|
|
@@ -6284,6 +6353,674 @@ var ObjectType;
|
|
|
6284
6353
|
ObjectType[ObjectType["Packed"] = 2] = "Packed";
|
|
6285
6354
|
})(ObjectType || (ObjectType = {}));
|
|
6286
6355
|
|
|
6356
|
+
/**
|
|
6357
|
+
* `PdfBoolean` class is used to perform boolean related primitive operations.
|
|
6358
|
+
* @private
|
|
6359
|
+
*/
|
|
6360
|
+
class PdfBoolean {
|
|
6361
|
+
//constructor
|
|
6362
|
+
/**
|
|
6363
|
+
* Initializes a new instance of the `PdfBoolean` class.
|
|
6364
|
+
* @private
|
|
6365
|
+
*/
|
|
6366
|
+
constructor(value) {
|
|
6367
|
+
/**
|
|
6368
|
+
* Internal variable to store the `position`.
|
|
6369
|
+
* @default -1
|
|
6370
|
+
* @private
|
|
6371
|
+
*/
|
|
6372
|
+
this.currentPosition = -1;
|
|
6373
|
+
this.value = value;
|
|
6374
|
+
}
|
|
6375
|
+
//Properties
|
|
6376
|
+
/**
|
|
6377
|
+
* Gets or sets the `Status` of the specified object.
|
|
6378
|
+
* @private
|
|
6379
|
+
*/
|
|
6380
|
+
get status() {
|
|
6381
|
+
return this.objectStatus;
|
|
6382
|
+
}
|
|
6383
|
+
set status(value) {
|
|
6384
|
+
this.objectStatus = value;
|
|
6385
|
+
}
|
|
6386
|
+
/**
|
|
6387
|
+
* Gets or sets a value indicating whether this document `is saving` or not.
|
|
6388
|
+
* @private
|
|
6389
|
+
*/
|
|
6390
|
+
get isSaving() {
|
|
6391
|
+
return this.saving;
|
|
6392
|
+
}
|
|
6393
|
+
set isSaving(value) {
|
|
6394
|
+
this.saving = value;
|
|
6395
|
+
}
|
|
6396
|
+
/**
|
|
6397
|
+
* Gets or sets the `index` value of the specified object.
|
|
6398
|
+
* @private
|
|
6399
|
+
*/
|
|
6400
|
+
get objectCollectionIndex() {
|
|
6401
|
+
return this.index;
|
|
6402
|
+
}
|
|
6403
|
+
set objectCollectionIndex(value) {
|
|
6404
|
+
this.index = value;
|
|
6405
|
+
}
|
|
6406
|
+
/**
|
|
6407
|
+
* Gets or sets the `position` of the object.
|
|
6408
|
+
* @private
|
|
6409
|
+
*/
|
|
6410
|
+
get position() {
|
|
6411
|
+
return this.currentPosition;
|
|
6412
|
+
}
|
|
6413
|
+
set position(value) {
|
|
6414
|
+
this.currentPosition = value;
|
|
6415
|
+
}
|
|
6416
|
+
/**
|
|
6417
|
+
* Returns `cloned object`.
|
|
6418
|
+
* @private
|
|
6419
|
+
*/
|
|
6420
|
+
get clonedObject() {
|
|
6421
|
+
let rValue = null;
|
|
6422
|
+
return rValue;
|
|
6423
|
+
}
|
|
6424
|
+
/**
|
|
6425
|
+
* `Saves` the object using the specified writer.
|
|
6426
|
+
* @private
|
|
6427
|
+
*/
|
|
6428
|
+
save(writer) {
|
|
6429
|
+
writer.write(this.boolToStr(this.value));
|
|
6430
|
+
}
|
|
6431
|
+
/**
|
|
6432
|
+
* Creates a `copy of PdfBoolean`.
|
|
6433
|
+
* @private
|
|
6434
|
+
*/
|
|
6435
|
+
clone(crossTable) {
|
|
6436
|
+
let newNumber = new PdfBoolean(this.value);
|
|
6437
|
+
return newNumber;
|
|
6438
|
+
}
|
|
6439
|
+
// Implementation
|
|
6440
|
+
/**
|
|
6441
|
+
* Converts `boolean to string` - 0/1 'true'/'false'.
|
|
6442
|
+
* @private
|
|
6443
|
+
*/
|
|
6444
|
+
boolToStr(value) {
|
|
6445
|
+
return value ? 'true' : 'false';
|
|
6446
|
+
}
|
|
6447
|
+
}
|
|
6448
|
+
|
|
6449
|
+
/**
|
|
6450
|
+
* Defines the way the document is to be presented on the screen or in print.
|
|
6451
|
+
* ```typescript
|
|
6452
|
+
* // Create a new PDF document
|
|
6453
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6454
|
+
* // Gets viewer preferences
|
|
6455
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6456
|
+
* // Destroy the document
|
|
6457
|
+
* document.destroy();
|
|
6458
|
+
* ```
|
|
6459
|
+
*/
|
|
6460
|
+
class PdfViewerPreferences {
|
|
6461
|
+
/**
|
|
6462
|
+
* Initialize a new instance of `PdfViewerPreferences` class.
|
|
6463
|
+
*
|
|
6464
|
+
* @private
|
|
6465
|
+
* ```
|
|
6466
|
+
*/
|
|
6467
|
+
constructor(catalog) {
|
|
6468
|
+
this._dictionaryProperties = new DictionaryProperties();
|
|
6469
|
+
this._centerWindow = false;
|
|
6470
|
+
this._fitWindow = false;
|
|
6471
|
+
this._displayTitle = false;
|
|
6472
|
+
this._splitWindow = false;
|
|
6473
|
+
this._hideMenuBar = false;
|
|
6474
|
+
this._hideToolBar = false;
|
|
6475
|
+
this._hideWindowUI = false;
|
|
6476
|
+
this._pageMode = PdfPageMode.UseNone;
|
|
6477
|
+
this._pageLayout = PdfPageLayout.SinglePage;
|
|
6478
|
+
this._dictionary = new PdfDictionary();
|
|
6479
|
+
this._duplex = DuplexMode.None;
|
|
6480
|
+
this._catalog = catalog;
|
|
6481
|
+
}
|
|
6482
|
+
/**
|
|
6483
|
+
* A flag specifying whether to position the document’s window in the center of the screen.
|
|
6484
|
+
* ```typescript
|
|
6485
|
+
* // Create a new PDF document
|
|
6486
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6487
|
+
* // Gets the viewer preferences of the document
|
|
6488
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6489
|
+
* // Gets the center window
|
|
6490
|
+
* let centerWindow : boolean = viewerPreferences.centerWindow;
|
|
6491
|
+
* // Destroy the document
|
|
6492
|
+
* document.destroy();
|
|
6493
|
+
* ```
|
|
6494
|
+
*/
|
|
6495
|
+
get centerWindow() {
|
|
6496
|
+
return this._centerWindow;
|
|
6497
|
+
}
|
|
6498
|
+
/**
|
|
6499
|
+
* A flag specifying whether to position the document’s window in the center of the screen.
|
|
6500
|
+
* ```typescript
|
|
6501
|
+
* // Create a new PDF document
|
|
6502
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6503
|
+
* // Gets the viewer preferences of the document
|
|
6504
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6505
|
+
* // Sets the center window
|
|
6506
|
+
* viewerPreferences.centerWindow = true;
|
|
6507
|
+
* // Destroy the document
|
|
6508
|
+
* document.destroy();
|
|
6509
|
+
* ```
|
|
6510
|
+
*/
|
|
6511
|
+
set centerWindow(value) {
|
|
6512
|
+
this._centerWindow = value;
|
|
6513
|
+
this._dictionary.items.setValue(this._dictionaryProperties.centerWindow, new PdfBoolean(this._centerWindow));
|
|
6514
|
+
}
|
|
6515
|
+
/**
|
|
6516
|
+
* A flag specifying whether the window’s title bar should display the document title taken
|
|
6517
|
+
* from the Title entry of the document information dictionary. If false, the title bar
|
|
6518
|
+
* should instead display the name of the PDF file containing the document.
|
|
6519
|
+
* ```typescript
|
|
6520
|
+
* // Create a new PDF document
|
|
6521
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6522
|
+
* // Gets the viewer preferences of the document
|
|
6523
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6524
|
+
* // Gets the display title
|
|
6525
|
+
* let displayTitle : boolean = viewerPreferences.displayTitle;
|
|
6526
|
+
* // Destroy the document
|
|
6527
|
+
* document.destroy();
|
|
6528
|
+
* ```
|
|
6529
|
+
*/
|
|
6530
|
+
get displayTitle() {
|
|
6531
|
+
return this._displayTitle;
|
|
6532
|
+
}
|
|
6533
|
+
/**
|
|
6534
|
+
* A flag specifying whether the window’s title bar should display the document title taken
|
|
6535
|
+
* from the Title entry of the document information dictionary. If false, the title bar
|
|
6536
|
+
* should instead display the name of the PDF file containing the document.
|
|
6537
|
+
* ```typescript
|
|
6538
|
+
* // Create a new PDF document
|
|
6539
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6540
|
+
* // Gets the viewer preferences of the document
|
|
6541
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6542
|
+
* // Sets the display title
|
|
6543
|
+
* viewerPreferences.displayTitle = true;
|
|
6544
|
+
* // Destroy the document
|
|
6545
|
+
* document.destroy();
|
|
6546
|
+
* ```
|
|
6547
|
+
*/
|
|
6548
|
+
set displayTitle(value) {
|
|
6549
|
+
this._displayTitle = value;
|
|
6550
|
+
this._dictionary.items.setValue(this._dictionaryProperties.displayTitle, new PdfBoolean(this._displayTitle));
|
|
6551
|
+
}
|
|
6552
|
+
/**
|
|
6553
|
+
* A flag specifying whether to resize the document’s window to fit the size of the first
|
|
6554
|
+
* displayed page.
|
|
6555
|
+
* ```typescript
|
|
6556
|
+
* // Create a new PDF document
|
|
6557
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6558
|
+
* // Gets the viewer preferences of the document
|
|
6559
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6560
|
+
* // Gets the fit window
|
|
6561
|
+
* let fitWindow : boolean = viewerPreferences.fitWindow;
|
|
6562
|
+
* // Destroy the document
|
|
6563
|
+
* document.destroy();
|
|
6564
|
+
* ```
|
|
6565
|
+
*/
|
|
6566
|
+
get fitWindow() {
|
|
6567
|
+
return this._fitWindow;
|
|
6568
|
+
}
|
|
6569
|
+
/**
|
|
6570
|
+
* A flag specifying whether to resize the document’s window to fit the size of the first
|
|
6571
|
+
* displayed page.
|
|
6572
|
+
* ```typescript
|
|
6573
|
+
* // Create a new PDF document
|
|
6574
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6575
|
+
* // Gets the viewer preferences of the document
|
|
6576
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6577
|
+
* // Sets the fit window
|
|
6578
|
+
* viewerPreferences.fitWindow = true;
|
|
6579
|
+
* // Destroy the document
|
|
6580
|
+
* document.destroy();
|
|
6581
|
+
* ```
|
|
6582
|
+
*/
|
|
6583
|
+
set fitWindow(value) {
|
|
6584
|
+
this._fitWindow = value;
|
|
6585
|
+
this._dictionary.items.setValue(this._dictionaryProperties.fitWindow, new PdfBoolean(this._fitWindow));
|
|
6586
|
+
}
|
|
6587
|
+
/**
|
|
6588
|
+
* A flag specifying whether to hide the viewer application’s menu bar when the
|
|
6589
|
+
* document is active.
|
|
6590
|
+
* ```typescript
|
|
6591
|
+
* // Create a new PDF document
|
|
6592
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6593
|
+
* // Gets the viewer preferences of the document
|
|
6594
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6595
|
+
* // Gets the hide menu bar
|
|
6596
|
+
* let hideMenuBar: boolean = viewerPreferences.hideMenuBar;
|
|
6597
|
+
* // Destroy the document
|
|
6598
|
+
* document.destroy();
|
|
6599
|
+
* ```
|
|
6600
|
+
*/
|
|
6601
|
+
get hideMenuBar() {
|
|
6602
|
+
return this._hideMenuBar;
|
|
6603
|
+
}
|
|
6604
|
+
/**
|
|
6605
|
+
* A flag specifying whether to hide the viewer application’s menu bar when the
|
|
6606
|
+
* document is active.
|
|
6607
|
+
* ```typescript
|
|
6608
|
+
* // Create a new PDF document
|
|
6609
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6610
|
+
* // Gets the viewer preferences of the document
|
|
6611
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6612
|
+
* // Sets the hide menu bar
|
|
6613
|
+
* viewerPreferences.hideMenuBar = true;
|
|
6614
|
+
* // Destroy the document
|
|
6615
|
+
* document.destroy();
|
|
6616
|
+
* ```
|
|
6617
|
+
*/
|
|
6618
|
+
set hideMenuBar(value) {
|
|
6619
|
+
this._hideMenuBar = value;
|
|
6620
|
+
this._dictionary.items.setValue(this._dictionaryProperties.hideMenuBar, new PdfBoolean(this._hideMenuBar));
|
|
6621
|
+
}
|
|
6622
|
+
/**
|
|
6623
|
+
* A flag specifying whether to hide the viewer application’s tool bar when the
|
|
6624
|
+
* document is active.
|
|
6625
|
+
* ```typescript
|
|
6626
|
+
* // Create a new PDF document
|
|
6627
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6628
|
+
* // Gets the viewer preferences of the document
|
|
6629
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6630
|
+
* // Gets the hide tool bar
|
|
6631
|
+
* let hideToolBar: boolean = viewerPreferences.hideToolBar;
|
|
6632
|
+
* // Destroy the document
|
|
6633
|
+
* document.destroy();
|
|
6634
|
+
* ```
|
|
6635
|
+
*/
|
|
6636
|
+
get hideToolBar() {
|
|
6637
|
+
return this._hideToolBar;
|
|
6638
|
+
}
|
|
6639
|
+
/**
|
|
6640
|
+
* A flag specifying whether to hide the viewer application’s tool bar when the
|
|
6641
|
+
* document is active.
|
|
6642
|
+
* ```typescript
|
|
6643
|
+
* // Create a new PDF document
|
|
6644
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6645
|
+
* // Gets the viewer preferences of the document
|
|
6646
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6647
|
+
* // Sets the hide tool bar
|
|
6648
|
+
* viewerPreferences.hideToolbar = true;
|
|
6649
|
+
* // Destroy the document
|
|
6650
|
+
* document.destroy();
|
|
6651
|
+
* ```
|
|
6652
|
+
*/
|
|
6653
|
+
set hideToolBar(value) {
|
|
6654
|
+
this._hideToolBar = value;
|
|
6655
|
+
this._dictionary.items.setValue(this._dictionaryProperties.hideToolBar, new PdfBoolean(this._hideToolBar));
|
|
6656
|
+
}
|
|
6657
|
+
/**
|
|
6658
|
+
* A flag specifying whether to hide user interface elements in the document’s window
|
|
6659
|
+
* (such as scroll bars and navigation controls), leaving only the document’s contents displayed.
|
|
6660
|
+
* ```typescript
|
|
6661
|
+
* // Create a new PDF document
|
|
6662
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6663
|
+
* // Gets the viewer preferences of the document
|
|
6664
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6665
|
+
* // Gets the hide window UI
|
|
6666
|
+
* let hideWindowUI: boolean = viewerPreferences.hideWindowUI;
|
|
6667
|
+
* // Destroy the document
|
|
6668
|
+
* document.destroy();
|
|
6669
|
+
* ```
|
|
6670
|
+
*/
|
|
6671
|
+
get hideWindowUI() {
|
|
6672
|
+
return this._hideWindowUI;
|
|
6673
|
+
}
|
|
6674
|
+
/**
|
|
6675
|
+
* A flag specifying whether to hide user interface elements in the document’s window
|
|
6676
|
+
* (such as scroll bars and navigation controls), leaving only the document’s contents displayed.
|
|
6677
|
+
* ```typescript
|
|
6678
|
+
* // Create a new PDF document
|
|
6679
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6680
|
+
* // Gets the viewer preferences of the document
|
|
6681
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6682
|
+
* // Sets the hide window UI
|
|
6683
|
+
* viewerPreferences.hideWindowUI = true;
|
|
6684
|
+
* // Destroy the document
|
|
6685
|
+
* document.destroy();
|
|
6686
|
+
* ```
|
|
6687
|
+
*/
|
|
6688
|
+
set hideWindowUI(value) {
|
|
6689
|
+
this._hideWindowUI = value;
|
|
6690
|
+
this._dictionary.items.setValue(this._dictionaryProperties.hideWindowUI, new PdfBoolean(this._hideWindowUI));
|
|
6691
|
+
}
|
|
6692
|
+
/**
|
|
6693
|
+
* A name object specifying how the document should be displayed when opened.
|
|
6694
|
+
* ```typescript
|
|
6695
|
+
* // Create a new PDF document
|
|
6696
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6697
|
+
* // Gets the viewer preferences of the document
|
|
6698
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6699
|
+
* // Gets the page mode
|
|
6700
|
+
* let pageMode: PdfPageMode = viewerPreferences.pageMode;
|
|
6701
|
+
* // Destroy the document
|
|
6702
|
+
* document.destroy();
|
|
6703
|
+
* ```
|
|
6704
|
+
*/
|
|
6705
|
+
get pageMode() {
|
|
6706
|
+
return this._pageMode;
|
|
6707
|
+
}
|
|
6708
|
+
/**
|
|
6709
|
+
* A name object specifying how the document should be displayed when opened.
|
|
6710
|
+
* ```typescript
|
|
6711
|
+
* // Create a new PDF document
|
|
6712
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6713
|
+
* // Gets the viewer preferences of the document
|
|
6714
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6715
|
+
* // Sets the page mode
|
|
6716
|
+
* viewerPreferences.pageMode = PdfPageMode.UseOutlines;
|
|
6717
|
+
* // Destroy the document
|
|
6718
|
+
* document.destroy();
|
|
6719
|
+
* ```
|
|
6720
|
+
*/
|
|
6721
|
+
set pageMode(value) {
|
|
6722
|
+
this._pageMode = value;
|
|
6723
|
+
this._catalog.items.setValue(this._dictionaryProperties.pageMode, new PdfName(this._mapPageMode(this._pageMode)));
|
|
6724
|
+
}
|
|
6725
|
+
/**
|
|
6726
|
+
* Gets print duplex mode handling option to use when printing the file from the print dialog.
|
|
6727
|
+
* ```typescript
|
|
6728
|
+
* // Create a new PDF document
|
|
6729
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6730
|
+
* // Gets the viewer preferences of the document
|
|
6731
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6732
|
+
* // Gets the duplex
|
|
6733
|
+
* let duplex : DuplexMode = viewerPreferences.duplex;
|
|
6734
|
+
* // Destroy the document
|
|
6735
|
+
* document.destroy();
|
|
6736
|
+
* ```
|
|
6737
|
+
*/
|
|
6738
|
+
get duplex() {
|
|
6739
|
+
return this._duplex;
|
|
6740
|
+
}
|
|
6741
|
+
/**
|
|
6742
|
+
* Sets print duplex mode handling option to use when printing the file from the print dialog.
|
|
6743
|
+
* ```typescript
|
|
6744
|
+
* // Create a new PDF document
|
|
6745
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6746
|
+
* // Gets the viewer preferences of the document
|
|
6747
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6748
|
+
* // Sets the duplex
|
|
6749
|
+
* viewerPreferences.duplex = DuplexMode.DuplexFlipLongEdge;
|
|
6750
|
+
* // Destroy the document
|
|
6751
|
+
* document.destroy();
|
|
6752
|
+
* ```
|
|
6753
|
+
*/
|
|
6754
|
+
set duplex(value) {
|
|
6755
|
+
this._duplex = value;
|
|
6756
|
+
this._catalog.items.setValue(this._dictionaryProperties.duplex, new PdfName(this._mapDuplexMode(this._duplex)));
|
|
6757
|
+
}
|
|
6758
|
+
/**
|
|
6759
|
+
* A name object specifying the page layout to be used when the document is opened.
|
|
6760
|
+
* ```typescript
|
|
6761
|
+
* // Create a new PDF document
|
|
6762
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6763
|
+
* // Gets the viewer preferences of the document
|
|
6764
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6765
|
+
* // Gets the page layout
|
|
6766
|
+
* let pageLayout : PdfPageLayout = viewerPreferences.pageLayout;
|
|
6767
|
+
* // Destroy the document
|
|
6768
|
+
* document.destroy();
|
|
6769
|
+
* ```
|
|
6770
|
+
*/
|
|
6771
|
+
get pageLayout() {
|
|
6772
|
+
return this._pageLayout;
|
|
6773
|
+
}
|
|
6774
|
+
/**
|
|
6775
|
+
* A name object specifying the page layout to be used when the document is opened.
|
|
6776
|
+
* ```typescript
|
|
6777
|
+
* // Create a new PDF document
|
|
6778
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6779
|
+
* // Gets the viewer preferences of the document
|
|
6780
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6781
|
+
* // Sets the page layout
|
|
6782
|
+
* viewerPreferences.pageLayout = PdfPageLayout.TwoColumnLeft;
|
|
6783
|
+
* // Destroy the document
|
|
6784
|
+
* document.destroy();
|
|
6785
|
+
* ```
|
|
6786
|
+
*/
|
|
6787
|
+
set pageLayout(value) {
|
|
6788
|
+
this._pageLayout = value;
|
|
6789
|
+
this._catalog.items.setValue(this._dictionaryProperties.pageLayout, new PdfName(this._mapPageLayout(this._pageLayout)));
|
|
6790
|
+
}
|
|
6791
|
+
/**
|
|
6792
|
+
* Gets the page scaling option to be selected
|
|
6793
|
+
* when a print dialog is displayed for this document.
|
|
6794
|
+
* ```typescript
|
|
6795
|
+
* // Create a new PDF document
|
|
6796
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6797
|
+
* // Gets the viewer preferences of the document
|
|
6798
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6799
|
+
* // Gets the page scaling
|
|
6800
|
+
* let pageScaling : PageScalingMode = viewerPreferences.pageScaling;
|
|
6801
|
+
* // Destroy the document
|
|
6802
|
+
* document.destroy();
|
|
6803
|
+
* ```
|
|
6804
|
+
*/
|
|
6805
|
+
get pageScaling() {
|
|
6806
|
+
return this._pageScaling;
|
|
6807
|
+
}
|
|
6808
|
+
/**
|
|
6809
|
+
* Sets the page scaling option to be selected
|
|
6810
|
+
* when a print dialog is displayed for this document.
|
|
6811
|
+
* ```typescript
|
|
6812
|
+
* // Create a new PDF document
|
|
6813
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6814
|
+
* // Gets the viewer preferences of the document
|
|
6815
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6816
|
+
* // Sets the page scaling
|
|
6817
|
+
* viewerPreferences.pageScaling = PageScalingMode.None;
|
|
6818
|
+
* // Destroy the document
|
|
6819
|
+
* document.destroy();
|
|
6820
|
+
* ```
|
|
6821
|
+
*/
|
|
6822
|
+
set pageScaling(value) {
|
|
6823
|
+
this._pageScaling = value;
|
|
6824
|
+
if (this._pageScaling === PageScalingMode.AppDefault && this._dictionary.items.containsKey(this._dictionaryProperties.printScaling)) {
|
|
6825
|
+
this._dictionary.items.remove(this._dictionaryProperties.printScaling);
|
|
6826
|
+
}
|
|
6827
|
+
else {
|
|
6828
|
+
this._dictionary.items.setValue(this._dictionaryProperties.printScaling, new PdfName('None'));
|
|
6829
|
+
}
|
|
6830
|
+
}
|
|
6831
|
+
/**
|
|
6832
|
+
* Primivie element
|
|
6833
|
+
*
|
|
6834
|
+
* @private
|
|
6835
|
+
*/
|
|
6836
|
+
get element() {
|
|
6837
|
+
return this._dictionary;
|
|
6838
|
+
}
|
|
6839
|
+
_mapDuplexMode(mode) {
|
|
6840
|
+
switch (mode) {
|
|
6841
|
+
case DuplexMode.Simplex:
|
|
6842
|
+
return 'Simplex';
|
|
6843
|
+
case DuplexMode.DuplexFlipShortEdge:
|
|
6844
|
+
return 'DuplexFlipShortEdge';
|
|
6845
|
+
case DuplexMode.DuplexFlipLongEdge:
|
|
6846
|
+
return 'DuplexFlipLongEdge';
|
|
6847
|
+
case DuplexMode.None:
|
|
6848
|
+
return 'None';
|
|
6849
|
+
}
|
|
6850
|
+
}
|
|
6851
|
+
_mapPageMode(mode) {
|
|
6852
|
+
switch (mode) {
|
|
6853
|
+
case PdfPageMode.UseNone:
|
|
6854
|
+
return 'UseNone';
|
|
6855
|
+
case PdfPageMode.UseOutlines:
|
|
6856
|
+
return 'UseOutlines';
|
|
6857
|
+
case PdfPageMode.UseThumbs:
|
|
6858
|
+
return 'UseThumbs';
|
|
6859
|
+
case PdfPageMode.FullScreen:
|
|
6860
|
+
return 'FullScreen';
|
|
6861
|
+
case PdfPageMode.UseOC:
|
|
6862
|
+
return 'UseOC';
|
|
6863
|
+
case PdfPageMode.UseAttachments:
|
|
6864
|
+
return 'UseAttachments';
|
|
6865
|
+
}
|
|
6866
|
+
}
|
|
6867
|
+
_mapPageLayout(layout) {
|
|
6868
|
+
switch (layout) {
|
|
6869
|
+
case PdfPageLayout.SinglePage:
|
|
6870
|
+
return 'SinglePage';
|
|
6871
|
+
case PdfPageLayout.OneColumn:
|
|
6872
|
+
return 'OneColumn';
|
|
6873
|
+
case PdfPageLayout.TwoColumnLeft:
|
|
6874
|
+
return 'TwoColumnLeft';
|
|
6875
|
+
case PdfPageLayout.TwoColumnRight:
|
|
6876
|
+
return 'TwoColumnRight';
|
|
6877
|
+
case PdfPageLayout.TwoPageLeft:
|
|
6878
|
+
return 'TwoPageLeft';
|
|
6879
|
+
case PdfPageLayout.TwoPageRight:
|
|
6880
|
+
return 'TwoPageRight';
|
|
6881
|
+
}
|
|
6882
|
+
}
|
|
6883
|
+
}
|
|
6884
|
+
/**
|
|
6885
|
+
* Represents mode of document displaying.
|
|
6886
|
+
* ```typescript
|
|
6887
|
+
* // Create a new PDF document
|
|
6888
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6889
|
+
* // Gets the viewer preferences of the document
|
|
6890
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6891
|
+
* // Sets the page mode
|
|
6892
|
+
* viewerPreferences.pageMode = PdfPageMode.UseOutlines;
|
|
6893
|
+
* // Destroy the document
|
|
6894
|
+
* document.destroy();
|
|
6895
|
+
* ```
|
|
6896
|
+
*/
|
|
6897
|
+
var PdfPageMode;
|
|
6898
|
+
(function (PdfPageMode) {
|
|
6899
|
+
/**
|
|
6900
|
+
* Default value. Neither document outline nor thumbnail images visible.
|
|
6901
|
+
*/
|
|
6902
|
+
PdfPageMode[PdfPageMode["UseNone"] = 0] = "UseNone";
|
|
6903
|
+
/**
|
|
6904
|
+
* Document outline visible.
|
|
6905
|
+
*/
|
|
6906
|
+
PdfPageMode[PdfPageMode["UseOutlines"] = 1] = "UseOutlines";
|
|
6907
|
+
/**
|
|
6908
|
+
* Thumbnail images visible.
|
|
6909
|
+
*/
|
|
6910
|
+
PdfPageMode[PdfPageMode["UseThumbs"] = 2] = "UseThumbs";
|
|
6911
|
+
/**
|
|
6912
|
+
* Full-screen mode, with no menu bar, window controls, or any other window visible.
|
|
6913
|
+
*/
|
|
6914
|
+
PdfPageMode[PdfPageMode["FullScreen"] = 3] = "FullScreen";
|
|
6915
|
+
/**
|
|
6916
|
+
* Optional content group panel visible.
|
|
6917
|
+
*/
|
|
6918
|
+
PdfPageMode[PdfPageMode["UseOC"] = 4] = "UseOC";
|
|
6919
|
+
/**
|
|
6920
|
+
* Attachments are visible.
|
|
6921
|
+
*/
|
|
6922
|
+
PdfPageMode[PdfPageMode["UseAttachments"] = 5] = "UseAttachments";
|
|
6923
|
+
})(PdfPageMode || (PdfPageMode = {}));
|
|
6924
|
+
/**
|
|
6925
|
+
* A name object specifying the page layout to be used when the document is opened.
|
|
6926
|
+
* ```typescript
|
|
6927
|
+
* // Create a new PDF document
|
|
6928
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6929
|
+
* // Gets the viewer preferences of the document
|
|
6930
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6931
|
+
* // Sets the page layout
|
|
6932
|
+
* viewerPreferences.pageLayout = PdfPageLayout.TwoColumnLeft;
|
|
6933
|
+
* // Destroy the document
|
|
6934
|
+
* document.destroy();
|
|
6935
|
+
* ```
|
|
6936
|
+
*/
|
|
6937
|
+
var PdfPageLayout;
|
|
6938
|
+
(function (PdfPageLayout) {
|
|
6939
|
+
/**
|
|
6940
|
+
* Default Value. Display one page at a time.
|
|
6941
|
+
*/
|
|
6942
|
+
PdfPageLayout[PdfPageLayout["SinglePage"] = 0] = "SinglePage";
|
|
6943
|
+
/**
|
|
6944
|
+
* Display the pages in one column.
|
|
6945
|
+
*/
|
|
6946
|
+
PdfPageLayout[PdfPageLayout["OneColumn"] = 1] = "OneColumn";
|
|
6947
|
+
/**
|
|
6948
|
+
* Display the pages in two columns, with odd numbered
|
|
6949
|
+
* pages on the left.
|
|
6950
|
+
*/
|
|
6951
|
+
PdfPageLayout[PdfPageLayout["TwoColumnLeft"] = 2] = "TwoColumnLeft";
|
|
6952
|
+
/**
|
|
6953
|
+
* Display the pages in two columns, with odd numbered
|
|
6954
|
+
* pages on the right.
|
|
6955
|
+
*/
|
|
6956
|
+
PdfPageLayout[PdfPageLayout["TwoColumnRight"] = 3] = "TwoColumnRight";
|
|
6957
|
+
/**
|
|
6958
|
+
* Display the pages two at a time, with odd-numbered pages on the left.
|
|
6959
|
+
*/
|
|
6960
|
+
PdfPageLayout[PdfPageLayout["TwoPageLeft"] = 4] = "TwoPageLeft";
|
|
6961
|
+
/**
|
|
6962
|
+
* Display the pages two at a time, with odd-numbered pages on the right.
|
|
6963
|
+
*/
|
|
6964
|
+
PdfPageLayout[PdfPageLayout["TwoPageRight"] = 5] = "TwoPageRight";
|
|
6965
|
+
})(PdfPageLayout || (PdfPageLayout = {}));
|
|
6966
|
+
/**
|
|
6967
|
+
* The paper handling option to use when printing the file from the print dialog.
|
|
6968
|
+
* ```typescript
|
|
6969
|
+
* // Create a new PDF document
|
|
6970
|
+
* let document : PdfDocument = new PdfDocument();
|
|
6971
|
+
* // Gets the viewer preferences of the document
|
|
6972
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
6973
|
+
* // Sets the duplex
|
|
6974
|
+
* viewerPreferences.duplex = DuplexMode.DuplexFlipLongEdge;
|
|
6975
|
+
* // Destroy the document
|
|
6976
|
+
* document.destroy();
|
|
6977
|
+
* ```
|
|
6978
|
+
*/
|
|
6979
|
+
var DuplexMode;
|
|
6980
|
+
(function (DuplexMode) {
|
|
6981
|
+
/**
|
|
6982
|
+
* Print single-sided.
|
|
6983
|
+
*/
|
|
6984
|
+
DuplexMode[DuplexMode["Simplex"] = 0] = "Simplex";
|
|
6985
|
+
/**
|
|
6986
|
+
* Duplex and flip on the short edge of the sheet.
|
|
6987
|
+
*/
|
|
6988
|
+
DuplexMode[DuplexMode["DuplexFlipShortEdge"] = 1] = "DuplexFlipShortEdge";
|
|
6989
|
+
/**
|
|
6990
|
+
* Duplex and flip on the long edge of the sheet.
|
|
6991
|
+
*/
|
|
6992
|
+
DuplexMode[DuplexMode["DuplexFlipLongEdge"] = 2] = "DuplexFlipLongEdge";
|
|
6993
|
+
/**
|
|
6994
|
+
* Default value.
|
|
6995
|
+
*/
|
|
6996
|
+
DuplexMode[DuplexMode["None"] = 3] = "None";
|
|
6997
|
+
})(DuplexMode || (DuplexMode = {}));
|
|
6998
|
+
/**
|
|
6999
|
+
* Specifies the different page scaling option that shall be selected
|
|
7000
|
+
* when a print dialog is displayed for this document.
|
|
7001
|
+
* ```typescript
|
|
7002
|
+
* // Create a new PDF document
|
|
7003
|
+
* let document : PdfDocument = new PdfDocument();
|
|
7004
|
+
* // Gets the viewer preferences of the document
|
|
7005
|
+
* let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
|
|
7006
|
+
* // Sets the page scaling
|
|
7007
|
+
* viewerPreferences.pageScaling = PageScalingMode.None;
|
|
7008
|
+
* // Destroy the document
|
|
7009
|
+
* document.destroy();
|
|
7010
|
+
* ```
|
|
7011
|
+
*/
|
|
7012
|
+
var PageScalingMode;
|
|
7013
|
+
(function (PageScalingMode) {
|
|
7014
|
+
/**
|
|
7015
|
+
* Indicates the conforming reader’s default print scaling.
|
|
7016
|
+
*/
|
|
7017
|
+
PageScalingMode[PageScalingMode["AppDefault"] = 0] = "AppDefault";
|
|
7018
|
+
/**
|
|
7019
|
+
* Indicates no page scaling.
|
|
7020
|
+
*/
|
|
7021
|
+
PageScalingMode[PageScalingMode["None"] = 1] = "None";
|
|
7022
|
+
})(PageScalingMode || (PageScalingMode = {}));
|
|
7023
|
+
|
|
6287
7024
|
/**
|
|
6288
7025
|
* PdfCatalog.ts class for EJ2-PDF
|
|
6289
7026
|
*/
|
|
@@ -6330,6 +7067,17 @@ class PdfCatalog extends PdfDictionary {
|
|
|
6330
7067
|
this.sections = value;
|
|
6331
7068
|
this.items.setValue(this.tempDictionaryProperties.pages, new PdfReferenceHolder(value));
|
|
6332
7069
|
}
|
|
7070
|
+
/**
|
|
7071
|
+
* Gets the viewer preferences of the PDF document.
|
|
7072
|
+
* @private
|
|
7073
|
+
*/
|
|
7074
|
+
get viewerPreferences() {
|
|
7075
|
+
if (this._viewerPreferences === null || typeof this._viewerPreferences === 'undefined') {
|
|
7076
|
+
this._viewerPreferences = new PdfViewerPreferences(this);
|
|
7077
|
+
this.items.setValue(this.tempDictionaryProperties.viewerPreferences, new PdfReferenceHolder(this._viewerPreferences.element));
|
|
7078
|
+
}
|
|
7079
|
+
return this._viewerPreferences;
|
|
7080
|
+
}
|
|
6333
7081
|
}
|
|
6334
7082
|
|
|
6335
7083
|
/**
|
|
@@ -9107,99 +9855,6 @@ class ByteArray {
|
|
|
9107
9855
|
}
|
|
9108
9856
|
}
|
|
9109
9857
|
|
|
9110
|
-
/**
|
|
9111
|
-
* `PdfBoolean` class is used to perform boolean related primitive operations.
|
|
9112
|
-
* @private
|
|
9113
|
-
*/
|
|
9114
|
-
class PdfBoolean {
|
|
9115
|
-
//constructor
|
|
9116
|
-
/**
|
|
9117
|
-
* Initializes a new instance of the `PdfBoolean` class.
|
|
9118
|
-
* @private
|
|
9119
|
-
*/
|
|
9120
|
-
constructor(value) {
|
|
9121
|
-
/**
|
|
9122
|
-
* Internal variable to store the `position`.
|
|
9123
|
-
* @default -1
|
|
9124
|
-
* @private
|
|
9125
|
-
*/
|
|
9126
|
-
this.currentPosition = -1;
|
|
9127
|
-
this.value = value;
|
|
9128
|
-
}
|
|
9129
|
-
//Properties
|
|
9130
|
-
/**
|
|
9131
|
-
* Gets or sets the `Status` of the specified object.
|
|
9132
|
-
* @private
|
|
9133
|
-
*/
|
|
9134
|
-
get status() {
|
|
9135
|
-
return this.objectStatus;
|
|
9136
|
-
}
|
|
9137
|
-
set status(value) {
|
|
9138
|
-
this.objectStatus = value;
|
|
9139
|
-
}
|
|
9140
|
-
/**
|
|
9141
|
-
* Gets or sets a value indicating whether this document `is saving` or not.
|
|
9142
|
-
* @private
|
|
9143
|
-
*/
|
|
9144
|
-
get isSaving() {
|
|
9145
|
-
return this.saving;
|
|
9146
|
-
}
|
|
9147
|
-
set isSaving(value) {
|
|
9148
|
-
this.saving = value;
|
|
9149
|
-
}
|
|
9150
|
-
/**
|
|
9151
|
-
* Gets or sets the `index` value of the specified object.
|
|
9152
|
-
* @private
|
|
9153
|
-
*/
|
|
9154
|
-
get objectCollectionIndex() {
|
|
9155
|
-
return this.index;
|
|
9156
|
-
}
|
|
9157
|
-
set objectCollectionIndex(value) {
|
|
9158
|
-
this.index = value;
|
|
9159
|
-
}
|
|
9160
|
-
/**
|
|
9161
|
-
* Gets or sets the `position` of the object.
|
|
9162
|
-
* @private
|
|
9163
|
-
*/
|
|
9164
|
-
get position() {
|
|
9165
|
-
return this.currentPosition;
|
|
9166
|
-
}
|
|
9167
|
-
set position(value) {
|
|
9168
|
-
this.currentPosition = value;
|
|
9169
|
-
}
|
|
9170
|
-
/**
|
|
9171
|
-
* Returns `cloned object`.
|
|
9172
|
-
* @private
|
|
9173
|
-
*/
|
|
9174
|
-
get clonedObject() {
|
|
9175
|
-
let rValue = null;
|
|
9176
|
-
return rValue;
|
|
9177
|
-
}
|
|
9178
|
-
/**
|
|
9179
|
-
* `Saves` the object using the specified writer.
|
|
9180
|
-
* @private
|
|
9181
|
-
*/
|
|
9182
|
-
save(writer) {
|
|
9183
|
-
writer.write(this.boolToStr(this.value));
|
|
9184
|
-
}
|
|
9185
|
-
/**
|
|
9186
|
-
* Creates a `copy of PdfBoolean`.
|
|
9187
|
-
* @private
|
|
9188
|
-
*/
|
|
9189
|
-
clone(crossTable) {
|
|
9190
|
-
let newNumber = new PdfBoolean(this.value);
|
|
9191
|
-
return newNumber;
|
|
9192
|
-
}
|
|
9193
|
-
// Implementation
|
|
9194
|
-
/**
|
|
9195
|
-
* Converts `boolean to string` - 0/1 'true'/'false'.
|
|
9196
|
-
* @private
|
|
9197
|
-
*/
|
|
9198
|
-
boolToStr(value) {
|
|
9199
|
-
return value ? 'true' : 'false';
|
|
9200
|
-
}
|
|
9201
|
-
}
|
|
9202
|
-
|
|
9203
9858
|
/**
|
|
9204
9859
|
* ImageDecoder class
|
|
9205
9860
|
*/
|