From 90fd27d6c8a3549e54dd20f919c4a44b2750fcdb Mon Sep 17 00:00:00 2001 From: Nikita Khromov Date: Mon, 27 Jan 2025 19:30:24 +0700 Subject: [PATCH] Fix bug #72818 --- pdf/api.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pdf/api.js b/pdf/api.js index 0809cdd3e5..e3e98c0629 100644 --- a/pdf/api.js +++ b/pdf/api.js @@ -925,7 +925,18 @@ this.sendEvent("asc_onHyperlinkClick", Url); }; + PDFEditorApi.prototype.add_Hyperlink = function(HyperProps) { + let oDoc = this.getPDFDoc(); + if (null != HyperProps.Text) { + AscFonts.FontPickerByCharacter.checkText(HyperProps.Text, this, function() { + oDoc.AddHyperlink(HyperProps); + }); + } + else { + oDoc.AddHyperlink(HyperProps); + } + }; PDFEditorApi.prototype.sync_VerticalTextAlign = function(align) { this.sendEvent("asc_onVerticalTextAlign", align); }; @@ -3114,6 +3125,7 @@ PDFEditorApi.prototype['remove_Hyperlink'] = PDFEditorApi.prototype.remove_Hyperlink; PDFEditorApi.prototype['change_Hyperlink'] = PDFEditorApi.prototype.change_Hyperlink; PDFEditorApi.prototype['sync_HyperlinkClickCallback'] = PDFEditorApi.prototype.sync_HyperlinkClickCallback; + PDFEditorApi.prototype['add_Hyperlink'] = PDFEditorApi.prototype.add_Hyperlink; PDFEditorApi.prototype['SetShowTextSelectPanel'] = PDFEditorApi.prototype.SetShowTextSelectPanel; PDFEditorApi.prototype['NeedShowTextSelectPanel'] = PDFEditorApi.prototype.NeedShowTextSelectPanel;