このWebページでは、ユーザーが自分の.NETアプリケーション内に、レポート、電子メールメッセージ、およびさまざまな種類のドキュメントへのハイパーリンクを動的に挿入する方法について説明します。 ハイパーリンクはWorldWideWebのバックボーンであり、さまざまなページやドキュメントをリンクしたり、クリックして現在のドキュメント内の新しいセクションにジャンプしたりするために使用できます。 GroupDocs.Assembly .NETは非常に強力なAPIであり、ソフトウェア開発者が数行のコードでドキュメントまたはレポート内にハイパーリンクを動的に追加するのに役立ちます。 PDF、HTML、Outlook電子メール、Microsoft Office Word、Excelワークシート、PowerPointプレゼンテーションなど、非常に人気のあるドキュメントタイプのサポートが含まれています。 ドキュメントページへのリンクの挿入、セルへのリンクの挿入、ハイパーリンクの編集、ハイパーリンクの代わりにテキストを表示する、ブックマークからリンクを動的に挿入する、プレゼンテーションスライドにハイパーリンクを挿入するなど、いくつかの高度な機能をサポートしていました。
GroupDocs.Assembly .NET APIは、さまざまなタイプのドキュメント内にハイパーリンクを挿入および編集するための完全なサポートを提供します。 次のC#.NETコード例は、Wordドキュメント内にハイパーリンクを簡単に追加する方法を示しています。
// Supported file formats: https://docs.groupdocs.com/watermark/java/supported-document-formats/ | |
const String strDocumentTemplate = "Word Templates/Dynamic Hyperlink.docx"; | |
const String strDocumentReport = "Word Reports/Dynamic Hyperlink.docx"; | |
const String uriExpression = "https://www.groupdocs.com/"; | |
const String displayTextExpression = "GroupDocs"; | |
try | |
{ | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.AssembleDocument(CommonUtilities.GetSourceDocument(strDocumentTemplate), CommonUtilities.SetDestinationDocument(strDocumentReport), | |
new DataSourceInfo(uriExpression,"uriExpression"), new DataSourceInfo(displayTextExpression,"displayTextExpression")); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} |
GroupDocs.Assembly .NET APIは、Spreadsheetファイル内のハイパーリンクの追加と処理を完全にサポートします。 その場所を簡単に編集したり、新しい場所に置き換えたりすることができます。 次のC#コードは、ユーザーが自分の.NETアプリ内のスプレッドシートファイルにハイパーリンクを簡単に挿入できることを示しています。
// Supported file formats: https://docs.groupdocs.com/watermark/java/supported-document-formats/ | |
const String strDocumentTemplate = "Spreadsheet Templates/Dynamic Hyperlink.xlsx"; | |
const String strDocumentReport = "Spreadsheet Reports/Dynamic Hyperlink.xlsx"; | |
const String uriExpression = "https://www.groupdocs.com/"; | |
const String displayTextExpression = "GroupDocs"; | |
try | |
{ | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.AssembleDocument(CommonUtilities.GetSourceDocument(strDocumentTemplate), CommonUtilities.SetDestinationDocument(strDocumentReport), | |
new DataSourceInfo(uriExpression,"uriExpression"), new DataSourceInfo(displayTextExpression,"displayTextExpression")); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} |
GroupDocs.Assembly for .NETは、ソフトウェアの専門家がさまざまな種類のドキュメントを管理するためのアプリケーションを構築するのに役立ちます。 次のコード例は、ソフトウェア開発者がPowerPointプレゼンテーションドキュメント内にハイパーリンクを追加する方法を示しています。
// Supported file formats: https://docs.groupdocs.com/watermark/java/supported-document-formats/ | |
const String strDocumentTemplate = "Presentation Templates/Dynamic Hyperlink.pptx"; | |
const String strDocumentReport = "Presentation Reports/Dynamic Hyperlink.pptx"; | |
const String uriExpression = "https://www.groupdocs.com/"; | |
const String displayTextExpression = "GroupDocs"; | |
try | |
{ | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.AssembleDocument(CommonUtilities.GetSourceDocument(strDocumentTemplate), CommonUtilities.SetDestinationDocument(strDocumentReport), | |
new DataSourceInfo(uriExpression,"uriExpression"), new DataSourceInfo(displayTextExpression,"displayTextExpression")); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} |
GroupDocs.Assembly .NET APIを使用すると、ソフトウェアの専門家は電子メールドキュメント内にハイパーリンクを挿入できます。 次の.NETコードは、プログラマーが自分の電子メールメッセージにハイパーリンクを追加し、自分の.NETアプリ内から他のユーザーに送信する方法を示しています。
// Supported file formats: https://docs.groupdocs.com/assembly/net/supported-document-formats/ | |
const String strDocumentTemplate = "Email Templates/Dynamic Hyperlink.msg"; | |
const String strDocumentReport = "Email Reports/Dynamic Hyperlink.msg"; | |
const String uriExpression = "https://www.groupdocs.com/"; | |
const String displayTextExpression = "GroupDocs"; | |
try | |
{ | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.AssembleDocument(CommonUtilities.GetSourceDocument(strDocumentTemplate), CommonUtilities.SetDestinationDocument(strDocumentReport), | |
new DataSourceInfo(uriExpression,"uriExpression"), new DataSourceInfo(displayTextExpression,"displayTextExpression")); | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} |
GroupDocs.Assembly .NET APIは、すべての主要なプラットフォームとオペレーティングシステムでサポートされています。 完全なシステム要件ガイドについては、システム要件 にアクセスしてください。以下のコードを実行する前に、次の前提条件がインストールされていることを確認してください。 システム:
(Portable Document Format)
(Hyper Text Markup Language)
(XML Paper Specifications)
(Tagged Image File Format)
(Web Page Archive Format)
(Text Document)
(XAML File)
(Open eBook File)
(Scalar Vector Graphics)
(PostScript File)
(Printer Command Language Document)
(XML File)
(OpenDocument Standard Format)
(OpenXPS File)
(Markdown Language)
(Microsoft PowerPoint Template Files)
(OpenDocument Standard Format)
(Microsoft Word Binary Format)
(Office 2007+ Word Document)
(Microsoft Word 2007 Marco File)
(Microsoft Word Template Files)
(Microsoft Word Template File )
(Microsoft Word 2007+ Template File)
(Rich Text Format)
(OpenDocument Text File Format)
(OpenDocument Standard Format)
(Microsoft Excel Spreadsheet (Legacy))
(Excel 97 - 2003 Template)
(Open XML Workbook)
(Macro-enabled Spreadsheet)
(Excel Template)
(Excel Macro-Enabled Template)
(Excel Binary Workbook)
(Open XML presentation Format)
(Macro-enabled Presentation File)
(PowerPoint Slide Show)
(PowerPoint Slide Show)
(Macro-enabled Slide Show)
(Microsoft PowerPoint Template Presentation)
(Microsoft PowerPoint Template File)
(OpenDocument Presentation Format)
(E-Mail Message)
(Apple Mail Message)
(Outlook Message Item File)