Skip to content

Commit

Permalink
[pdf] Added stamps.json loading
Browse files Browse the repository at this point in the history
  • Loading branch information
KhromovNikita committed Dec 12, 2024
1 parent e659210 commit 666f137
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 41 deletions.
24 changes: 24 additions & 0 deletions pdf/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1952,6 +1952,30 @@
PDFEditorApi.prototype.asc_getPropertyEditorStamps = function() {
return this.stampAnnotPreviewManager.getStampPreviews();
};
PDFEditorApi.prototype.loadStampsJSON = function() {
try {
var xhr = new XMLHttpRequest();
xhr.open("GET", "../../../../sdkjs/pdf/src/annotations/stamps.json", true);
var t = this;
xhr.onload = function()
{
if (this.status === 200 || location.href.indexOf("file:") === 0)
{
try
{
AscPDF["STAMPS_JSON"] = AscPDF.STAMPS_JSON = JSON.parse(this.responseText);
}
catch (err) {}
}
};
xhr.send('');
}
catch (e) {}
};
PDFEditorApi.prototype._init = function() {
AscCommon.DocumentEditorApi.prototype._init.call(this);
this.loadStampsJSON();
}
PDFEditorApi.prototype._coAuthoringInitEnd = function() {
AscCommon.DocumentEditorApi.prototype._coAuthoringInitEnd.call(this);

Expand Down
Loading

0 comments on commit 666f137

Please sign in to comment.