@syncfusion/ej2-pdf-export 30.2.4 → 31.2.2
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/dist/ej2-pdf-export.min.js +3 -3
- package/dist/ej2-pdf-export.umd.min.js +3 -3
- package/dist/ej2-pdf-export.umd.min.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es2015.js +142 -23
- package/dist/es6/ej2-pdf-export.es2015.js.map +1 -1
- package/dist/es6/ej2-pdf-export.es5.js +148 -21
- package/dist/es6/ej2-pdf-export.es5.js.map +1 -1
- package/dist/global/ej2-pdf-export.min.js +3 -3
- package/dist/global/ej2-pdf-export.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +2 -2
- package/src/implementation/input-output/pdf-cross-table.js +2 -1
- package/src/implementation/input-output/pdf-writer.d.ts +77 -14
- package/src/implementation/input-output/pdf-writer.js +146 -20
|
@@ -6561,16 +6561,124 @@ var PdfFont = /** @__PURE__ @class */ (function () {
|
|
|
6561
6561
|
return PdfFont;
|
|
6562
6562
|
}());
|
|
6563
6563
|
|
|
6564
|
+
/**
|
|
6565
|
+
* Helper class for chunk buffer.
|
|
6566
|
+
* @private
|
|
6567
|
+
*/
|
|
6568
|
+
var _PdfChunkBuffer = /** @__PURE__ @class */ (function () {
|
|
6569
|
+
/**
|
|
6570
|
+
* Initialize an instance of `_PdfChunkBuffer` class.
|
|
6571
|
+
* @private
|
|
6572
|
+
*/
|
|
6573
|
+
function _PdfChunkBuffer(chunkSize) {
|
|
6574
|
+
if (chunkSize === void 0) { chunkSize = 1048576; }
|
|
6575
|
+
/**
|
|
6576
|
+
* Specifies the `chunks`.
|
|
6577
|
+
* @private
|
|
6578
|
+
*/
|
|
6579
|
+
this.chunks = [];
|
|
6580
|
+
/**
|
|
6581
|
+
* Specifies the `offset`.
|
|
6582
|
+
* @private
|
|
6583
|
+
*/
|
|
6584
|
+
this.offset = 0;
|
|
6585
|
+
/**
|
|
6586
|
+
* Specifies the `committed`.
|
|
6587
|
+
* @private
|
|
6588
|
+
*/
|
|
6589
|
+
this.committed = 0;
|
|
6590
|
+
this.chunkSize = chunkSize;
|
|
6591
|
+
this.current = new Uint8Array(this.chunkSize);
|
|
6592
|
+
this.chunks.push(this.current);
|
|
6593
|
+
}
|
|
6594
|
+
Object.defineProperty(_PdfChunkBuffer.prototype, "length", {
|
|
6595
|
+
/**
|
|
6596
|
+
* Gets the `length`.
|
|
6597
|
+
* @private
|
|
6598
|
+
*/
|
|
6599
|
+
get: function () {
|
|
6600
|
+
return this.committed + this.offset;
|
|
6601
|
+
},
|
|
6602
|
+
enumerable: true,
|
|
6603
|
+
configurable: true
|
|
6604
|
+
});
|
|
6605
|
+
/**
|
|
6606
|
+
* Grows the buffer by allocating a new chunk.
|
|
6607
|
+
* @private
|
|
6608
|
+
*/
|
|
6609
|
+
_PdfChunkBuffer.prototype.grow = function () {
|
|
6610
|
+
this.committed += this.offset;
|
|
6611
|
+
this.current = new Uint8Array(this.chunkSize);
|
|
6612
|
+
this.chunks.push(this.current);
|
|
6613
|
+
this.offset = 0;
|
|
6614
|
+
};
|
|
6615
|
+
/**
|
|
6616
|
+
* Writes ASCII string as bytes (each charCodeAt masked to 0..255).
|
|
6617
|
+
* @private
|
|
6618
|
+
*/
|
|
6619
|
+
_PdfChunkBuffer.prototype.writeAscii = function (str) {
|
|
6620
|
+
var idx = 0;
|
|
6621
|
+
while (idx < str.length) {
|
|
6622
|
+
if (this.offset >= this.current.byteLength) {
|
|
6623
|
+
this.grow();
|
|
6624
|
+
}
|
|
6625
|
+
var space = this.current.byteLength - this.offset;
|
|
6626
|
+
var toWrite = Math.min(space, str.length - idx);
|
|
6627
|
+
for (var i = 0; i < toWrite; i++) {
|
|
6628
|
+
this.current[this.offset + i] = str.charCodeAt(idx + i) & 0xFF;
|
|
6629
|
+
}
|
|
6630
|
+
this.offset += toWrite;
|
|
6631
|
+
idx += toWrite;
|
|
6632
|
+
}
|
|
6633
|
+
};
|
|
6634
|
+
/**
|
|
6635
|
+
* Converts to `Uint8Array`.
|
|
6636
|
+
* @private
|
|
6637
|
+
*/
|
|
6638
|
+
_PdfChunkBuffer.prototype.toUint8Array = function () {
|
|
6639
|
+
var total = this.length;
|
|
6640
|
+
var out = new Uint8Array(total);
|
|
6641
|
+
var pos = 0;
|
|
6642
|
+
var lastIdx = this.chunks.length - 1;
|
|
6643
|
+
for (var i = 0; i <= lastIdx; i++) {
|
|
6644
|
+
var chunk = this.chunks[i];
|
|
6645
|
+
if (i === lastIdx) {
|
|
6646
|
+
out.set(chunk.subarray(0, this.offset), pos);
|
|
6647
|
+
pos += this.offset;
|
|
6648
|
+
}
|
|
6649
|
+
else {
|
|
6650
|
+
out.set(chunk, pos);
|
|
6651
|
+
pos += chunk.byteLength;
|
|
6652
|
+
}
|
|
6653
|
+
}
|
|
6654
|
+
return out;
|
|
6655
|
+
};
|
|
6656
|
+
/**
|
|
6657
|
+
* Destroys the array buffer.
|
|
6658
|
+
* @private
|
|
6659
|
+
*/
|
|
6660
|
+
_PdfChunkBuffer.prototype.destroy = function () {
|
|
6661
|
+
this.chunks = [];
|
|
6662
|
+
this.current = undefined;
|
|
6663
|
+
this.offset = 0;
|
|
6664
|
+
this.committed = 0;
|
|
6665
|
+
};
|
|
6666
|
+
return _PdfChunkBuffer;
|
|
6667
|
+
}());
|
|
6564
6668
|
/**
|
|
6565
6669
|
* Used to `write a string` into output file.
|
|
6566
6670
|
* @private
|
|
6567
6671
|
*/
|
|
6568
6672
|
var PdfWriter = /** @__PURE__ @class */ (function () {
|
|
6569
6673
|
function PdfWriter(stream) {
|
|
6674
|
+
/**
|
|
6675
|
+
* Specifies the `byteCountForStreamWriter`.
|
|
6676
|
+
* @private
|
|
6677
|
+
*/
|
|
6678
|
+
this.byteCountForStreamWriter = 0;
|
|
6570
6679
|
this.streamWriter = stream;
|
|
6571
6680
|
}
|
|
6572
6681
|
Object.defineProperty(PdfWriter.prototype, "document", {
|
|
6573
|
-
//properties
|
|
6574
6682
|
/**
|
|
6575
6683
|
* Gets and Sets the `document`.
|
|
6576
6684
|
* @private
|
|
@@ -6590,7 +6698,11 @@ var PdfWriter = /** @__PURE__ @class */ (function () {
|
|
|
6590
6698
|
* @private
|
|
6591
6699
|
*/
|
|
6592
6700
|
get: function () {
|
|
6593
|
-
|
|
6701
|
+
if (this.streamWriter instanceof PdfWriterHelper) {
|
|
6702
|
+
return this.streamWriter.buffer.size;
|
|
6703
|
+
}
|
|
6704
|
+
// For StreamWriter, we keep an internal count based on written characters
|
|
6705
|
+
return this.byteCountForStreamWriter;
|
|
6594
6706
|
},
|
|
6595
6707
|
enumerable: true,
|
|
6596
6708
|
configurable: true
|
|
@@ -6601,7 +6713,7 @@ var PdfWriter = /** @__PURE__ @class */ (function () {
|
|
|
6601
6713
|
* @private
|
|
6602
6714
|
*/
|
|
6603
6715
|
get: function () {
|
|
6604
|
-
return this.
|
|
6716
|
+
return this.position;
|
|
6605
6717
|
},
|
|
6606
6718
|
enumerable: true,
|
|
6607
6719
|
configurable: true
|
|
@@ -6617,14 +6729,21 @@ var PdfWriter = /** @__PURE__ @class */ (function () {
|
|
|
6617
6729
|
enumerable: true,
|
|
6618
6730
|
configurable: true
|
|
6619
6731
|
});
|
|
6620
|
-
//public Methods
|
|
6621
6732
|
/**
|
|
6622
6733
|
* `Writes the specified data`.
|
|
6623
6734
|
* @private
|
|
6624
6735
|
*/
|
|
6625
|
-
PdfWriter.prototype.write = function (
|
|
6626
|
-
|
|
6627
|
-
|
|
6736
|
+
PdfWriter.prototype.write = function (data) {
|
|
6737
|
+
if (typeof data === 'number') {
|
|
6738
|
+
data = String.fromCharCode(data);
|
|
6739
|
+
}
|
|
6740
|
+
if (this.streamWriter instanceof PdfWriterHelper) {
|
|
6741
|
+
this.streamWriter.write(data);
|
|
6742
|
+
}
|
|
6743
|
+
else {
|
|
6744
|
+
this.streamWriter.write(data);
|
|
6745
|
+
this.byteCountForStreamWriter += data.length;
|
|
6746
|
+
}
|
|
6628
6747
|
};
|
|
6629
6748
|
return PdfWriter;
|
|
6630
6749
|
}());
|
|
@@ -6637,8 +6756,9 @@ var PdfWriterHelper = /** @__PURE__ @class */ (function () {
|
|
|
6637
6756
|
* Initialize an instance of `PdfWriterHelper` class.
|
|
6638
6757
|
* @private
|
|
6639
6758
|
*/
|
|
6640
|
-
function PdfWriterHelper() {
|
|
6641
|
-
|
|
6759
|
+
function PdfWriterHelper(chunkSize) {
|
|
6760
|
+
if (chunkSize === void 0) { chunkSize = 1048576; }
|
|
6761
|
+
this.buffer = new PdfArrayBuffer(chunkSize);
|
|
6642
6762
|
}
|
|
6643
6763
|
/**
|
|
6644
6764
|
* Writes the specified data.
|
|
@@ -6668,8 +6788,9 @@ var PdfArrayBuffer = /** @__PURE__ @class */ (function () {
|
|
|
6668
6788
|
* Initialize an instance of `PdfArrayBuffer` class.
|
|
6669
6789
|
* @private
|
|
6670
6790
|
*/
|
|
6671
|
-
function PdfArrayBuffer() {
|
|
6672
|
-
|
|
6791
|
+
function PdfArrayBuffer(chunkSize) {
|
|
6792
|
+
if (chunkSize === void 0) { chunkSize = 1048576; }
|
|
6793
|
+
this.buf = new _PdfChunkBuffer(chunkSize);
|
|
6673
6794
|
}
|
|
6674
6795
|
Object.defineProperty(PdfArrayBuffer.prototype, "size", {
|
|
6675
6796
|
/**
|
|
@@ -6677,7 +6798,7 @@ var PdfArrayBuffer = /** @__PURE__ @class */ (function () {
|
|
|
6677
6798
|
* @private
|
|
6678
6799
|
*/
|
|
6679
6800
|
get: function () {
|
|
6680
|
-
return this.
|
|
6801
|
+
return this.buf.length;
|
|
6681
6802
|
},
|
|
6682
6803
|
enumerable: true,
|
|
6683
6804
|
configurable: true
|
|
@@ -6687,18 +6808,23 @@ var PdfArrayBuffer = /** @__PURE__ @class */ (function () {
|
|
|
6687
6808
|
* @private
|
|
6688
6809
|
*/
|
|
6689
6810
|
PdfArrayBuffer.prototype.write = function (value) {
|
|
6690
|
-
|
|
6691
|
-
this.buffer.push(value.charCodeAt(i) & 0xff);
|
|
6692
|
-
}
|
|
6811
|
+
this.buf.writeAscii(value);
|
|
6693
6812
|
};
|
|
6694
6813
|
/**
|
|
6695
|
-
*
|
|
6814
|
+
* Converts to `Uint8Array`.
|
|
6815
|
+
* @private
|
|
6816
|
+
*/
|
|
6817
|
+
PdfArrayBuffer.prototype.toUint8Array = function () {
|
|
6818
|
+
return this.buf.toUint8Array();
|
|
6819
|
+
};
|
|
6820
|
+
/**
|
|
6821
|
+
* Destroys the buffer.
|
|
6696
6822
|
* @private
|
|
6697
6823
|
*/
|
|
6698
6824
|
PdfArrayBuffer.prototype.destroy = function () {
|
|
6699
|
-
if (this.
|
|
6700
|
-
this.
|
|
6701
|
-
this.
|
|
6825
|
+
if (this.buf) {
|
|
6826
|
+
this.buf.destroy();
|
|
6827
|
+
this.buf = undefined;
|
|
6702
6828
|
}
|
|
6703
6829
|
};
|
|
6704
6830
|
return PdfArrayBuffer;
|
|
@@ -8039,7 +8165,8 @@ var PdfCrossTable = /** @__PURE__ @class */ (function () {
|
|
|
8039
8165
|
*/
|
|
8040
8166
|
PdfCrossTable.prototype._save = function (writer) {
|
|
8041
8167
|
this._saveProcess(writer);
|
|
8042
|
-
|
|
8168
|
+
var helper = writer.stream;
|
|
8169
|
+
return helper.buffer.toUint8Array();
|
|
8043
8170
|
};
|
|
8044
8171
|
/**
|
|
8045
8172
|
* `Saves the endess` of the file.
|
|
@@ -36607,5 +36734,5 @@ var PdfPageTemplateElement = /** @__PURE__ @class */ (function () {
|
|
|
36607
36734
|
return PdfPageTemplateElement;
|
|
36608
36735
|
}());
|
|
36609
36736
|
|
|
36610
|
-
export { ArabicShape, ArabicShapeRenderer, BeginPageLayoutEventArgs, Bidi, ByteArray, Dictionary, DictionaryProperties, DuplexMode, ElementLayouter, EndPageLayoutEventArgs, FontDescriptorFlags, FontEncoding, GetResourceEventHandler, GridCellEventArgs, Guid, ImageDecoder, ImageFormat, InternalEnum, LineInfo, LineType, Matrix, ObjectInfo, ObjectStatus, ObjectType, Operators, PageAddedEventArgs, PageScalingMode, PageSettingsState, PathPointType, PdfAction, PdfActionLinkAnnotation, PdfAlignmentStyle, PdfAnnotation, PdfAnnotationCollection, PdfArc, PdfArray, PdfArrayBuffer, PdfBitmap, PdfBlend, PdfBlendMode, PdfBorderOverlapStyle, PdfBorders, PdfBrush, PdfBrushes, PdfCacheCollection, PdfCancelEventArgs, PdfCatalog, PdfCollection, PdfColor, PdfColorBlend, PdfColorSpace, PdfCompositeField, PdfCrossTable, PdfDashStyle, PdfDestination, PdfDestinationMode, PdfDictionary, PdfDockStyle, PdfDocument, PdfDocumentBase, PdfDocumentLinkAnnotation, PdfDocumentPageCollection, PdfDocumentTemplate, PdfFillMode, PdfFont, PdfFontFamily, PdfFontMetrics, PdfFontStyle, PdfFontType, PdfFunction, PdfGradientBrush, PdfGraphics, PdfGraphicsState, PdfGraphicsUnit, PdfGrid, PdfGridBeginCellDrawEventArgs, PdfGridBeginPageLayoutEventArgs, PdfGridCell, PdfGridCellCollection, PdfGridCellStyle, PdfGridColumn, PdfGridColumnCollection, PdfGridEndCellDrawEventArgs, PdfGridEndPageLayoutEventArgs, PdfGridHeaderCollection, PdfGridImagePosition, PdfGridLayoutFormat, PdfGridLayoutResult, PdfGridLayouter, PdfGridRow, PdfGridRowCollection, PdfGridRowStyle, PdfGridStyle, PdfGridStyleBase, PdfHorizontalAlignment, PdfHorizontalOverflowType, PdfImage, PdfLayoutBreakType, PdfLayoutElement, PdfLayoutFormat, PdfLayoutParams, PdfLayoutResult, PdfLayoutType, PdfLineCap, PdfLineJoin, PdfLinearGradientBrush, PdfLinkAnnotation, PdfMainObjectCollection, PdfMargins, PdfName, PdfNumber, PdfNumberStyle, PdfPaddings, PdfPage, PdfPageBase, PdfPageCountField, PdfPageLayer, PdfPageLayerCollection, PdfPageLayout, PdfPageMode, PdfPageNumberField, PdfPageOrientation, PdfPageRotateAngle, PdfPageSettings, PdfPageSize, PdfPageTemplateElement, PdfPath, PdfPen, PdfRadialGradientBrush, PdfReference, PdfReferenceHolder, PdfResources, PdfSampledFunction, PdfSection, PdfSectionCollection, PdfSectionPageCollection, PdfSectionTemplate, PdfSolidBrush, PdfStandardFont, PdfStandardFontMetricsFactory, PdfStream, PdfStreamWriter, PdfString, PdfStringFormat, PdfStringLayoutResult, PdfStringLayouter, PdfSubSuperScript, PdfTemplate, PdfTextAlignment, PdfTextDirection, PdfTextElement, PdfTextLayoutResult, PdfTextWebLink, PdfTilingBrush, PdfTransformationMatrix, PdfTransparency, PdfTrueTypeFont, PdfUriAction, PdfUriAnnotation, PdfVerticalAlignment, PdfViewerPreferences, PdfWordWrapType, PdfWriter, PdfWriterHelper, PointF, ProcedureSets, Rectangle, RectangleF, RegisteredObject, RowLayoutResult, RtlCharacters, RtlRenderer, SaveAnnotationEventHandler, SaveCmapEventHandler, SaveDescendantFontEventHandler, SaveFontDictionaryEventHandler, SaveFontProgramEventHandler, SaveSectionCollectionEventHandler, SaveSectionEventHandler, SaveTemplateEventHandler, SizeF, StandardWidthTable, StringTokenizer, TemplateType, TextLayouter, TextPageLayoutResult, TextRenderingMode, TtfCmapEncoding, TtfCmapFormat, TtfCompositeGlyphFlags, TtfMacintoshEncodingID, TtfMicrosoftEncodingID, TtfPlatformID, WidthTable, defaultToString };
|
|
36737
|
+
export { ArabicShape, ArabicShapeRenderer, BeginPageLayoutEventArgs, Bidi, ByteArray, Dictionary, DictionaryProperties, DuplexMode, ElementLayouter, EndPageLayoutEventArgs, FontDescriptorFlags, FontEncoding, GetResourceEventHandler, GridCellEventArgs, Guid, ImageDecoder, ImageFormat, InternalEnum, LineInfo, LineType, Matrix, ObjectInfo, ObjectStatus, ObjectType, Operators, PageAddedEventArgs, PageScalingMode, PageSettingsState, PathPointType, PdfAction, PdfActionLinkAnnotation, PdfAlignmentStyle, PdfAnnotation, PdfAnnotationCollection, PdfArc, PdfArray, PdfArrayBuffer, PdfBitmap, PdfBlend, PdfBlendMode, PdfBorderOverlapStyle, PdfBorders, PdfBrush, PdfBrushes, PdfCacheCollection, PdfCancelEventArgs, PdfCatalog, PdfCollection, PdfColor, PdfColorBlend, PdfColorSpace, PdfCompositeField, PdfCrossTable, PdfDashStyle, PdfDestination, PdfDestinationMode, PdfDictionary, PdfDockStyle, PdfDocument, PdfDocumentBase, PdfDocumentLinkAnnotation, PdfDocumentPageCollection, PdfDocumentTemplate, PdfFillMode, PdfFont, PdfFontFamily, PdfFontMetrics, PdfFontStyle, PdfFontType, PdfFunction, PdfGradientBrush, PdfGraphics, PdfGraphicsState, PdfGraphicsUnit, PdfGrid, PdfGridBeginCellDrawEventArgs, PdfGridBeginPageLayoutEventArgs, PdfGridCell, PdfGridCellCollection, PdfGridCellStyle, PdfGridColumn, PdfGridColumnCollection, PdfGridEndCellDrawEventArgs, PdfGridEndPageLayoutEventArgs, PdfGridHeaderCollection, PdfGridImagePosition, PdfGridLayoutFormat, PdfGridLayoutResult, PdfGridLayouter, PdfGridRow, PdfGridRowCollection, PdfGridRowStyle, PdfGridStyle, PdfGridStyleBase, PdfHorizontalAlignment, PdfHorizontalOverflowType, PdfImage, PdfLayoutBreakType, PdfLayoutElement, PdfLayoutFormat, PdfLayoutParams, PdfLayoutResult, PdfLayoutType, PdfLineCap, PdfLineJoin, PdfLinearGradientBrush, PdfLinkAnnotation, PdfMainObjectCollection, PdfMargins, PdfName, PdfNumber, PdfNumberStyle, PdfPaddings, PdfPage, PdfPageBase, PdfPageCountField, PdfPageLayer, PdfPageLayerCollection, PdfPageLayout, PdfPageMode, PdfPageNumberField, PdfPageOrientation, PdfPageRotateAngle, PdfPageSettings, PdfPageSize, PdfPageTemplateElement, PdfPath, PdfPen, PdfRadialGradientBrush, PdfReference, PdfReferenceHolder, PdfResources, PdfSampledFunction, PdfSection, PdfSectionCollection, PdfSectionPageCollection, PdfSectionTemplate, PdfSolidBrush, PdfStandardFont, PdfStandardFontMetricsFactory, PdfStream, PdfStreamWriter, PdfString, PdfStringFormat, PdfStringLayoutResult, PdfStringLayouter, PdfSubSuperScript, PdfTemplate, PdfTextAlignment, PdfTextDirection, PdfTextElement, PdfTextLayoutResult, PdfTextWebLink, PdfTilingBrush, PdfTransformationMatrix, PdfTransparency, PdfTrueTypeFont, PdfUriAction, PdfUriAnnotation, PdfVerticalAlignment, PdfViewerPreferences, PdfWordWrapType, PdfWriter, PdfWriterHelper, PointF, ProcedureSets, Rectangle, RectangleF, RegisteredObject, RowLayoutResult, RtlCharacters, RtlRenderer, SaveAnnotationEventHandler, SaveCmapEventHandler, SaveDescendantFontEventHandler, SaveFontDictionaryEventHandler, SaveFontProgramEventHandler, SaveSectionCollectionEventHandler, SaveSectionEventHandler, SaveTemplateEventHandler, SizeF, StandardWidthTable, StringTokenizer, TemplateType, TextLayouter, TextPageLayoutResult, TextRenderingMode, TtfCmapEncoding, TtfCmapFormat, TtfCompositeGlyphFlags, TtfMacintoshEncodingID, TtfMicrosoftEncodingID, TtfPlatformID, WidthTable, _PdfChunkBuffer, defaultToString };
|
|
36611
36738
|
//# sourceMappingURL=ej2-pdf-export.es5.js.map
|