超链接是一个单词、短语或图像,您可以单击它来跳转到新文档或当前文档中的新部分。 超链接是万维网的主干,用于万维网上的许多必要功能。 GroupDocs.Assembly for Java 是一个文档自动化和报告生成 API,可帮助软件开发人员在其文档中动态插入超链接或轻松地报告。 该 API 非常稳定,完全支持与超链接管理相关的多项高级功能,例如向文档页面添加超链接、向演示幻灯片添加链接、向电子表格单元格添加超链接、修改超链接内容、从书签中动态插入链接、删除不需要的链接 链接,显示文本而不是超链接,等等。 完全支持一些非常常见的文档类型,如 PDF、HTML、Outlook 电子邮件、Microsoft Office Word、Excel 工作表、PowerPoint 演示文稿等。
GroupDocs.Assembly Java API 完全支持在各种常用文档格式中插入和编辑超链接。 下面的 Java 代码示例显示了如何在 Microsoft Word 文档中插入超链接。
// Supported file formats: https://docs.groupdocs.com/assembly/java/supported-document-formats/ | |
String strDocumentTemplate = "/Word Templates/Dynamic Hyperlink.docx"; | |
String strDocumentReport = "/Word Reports/Dynamic Hyperlink.docx"; | |
String uriExpression = "https://www.groupdocs.com/"; | |
String displayTextExpression = "GroupDocs"; | |
try | |
{ | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.assembleDocument(CommonUtilities.getDataPath(strDocumentTemplate), CommonUtilities.getOutPath(strDocumentReport), | |
new DataSourceInfo(uriExpression,"uriExpression"), | |
new DataSourceInfo(displayTextExpression,"displayTextExpression")); | |
} | |
catch (Exception exp) | |
{ | |
System.out.println("Exception: " + exp.getMessage()); | |
} |
GroupDocs.Assembly Java API 允许计算机程序员在其电子表格文档中轻松插入和修改超链接。 他们可以轻松访问、编辑其位置或将其替换为新位置。 以下 Java 代码演示了程序员如何轻松地在其电子表格中添加超链接。
// Supported file formats: https://docs.groupdocs.com/assembly/java/supported-document-formats/ | |
String strDocumentTemplate = "/Spreadsheet Templates/Dynamic Hyperlink.xlsx"; | |
String strDocumentReport = "/Spreadsheet Reports/Dynamic Hyperlink.xlsx"; | |
String uriExpression = "https://www.groupdocs.com/"; | |
String displayTextExpression = "GroupDocs"; | |
try | |
{ | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.assembleDocument(CommonUtilities.getDataPath(strDocumentTemplate), CommonUtilities.getOutPath(strDocumentReport), | |
new DataSourceInfo(uriExpression,"uriExpression"), | |
new DataSourceInfo(displayTextExpression,"displayTextExpression")); | |
} | |
catch (Exception exp) | |
{ | |
System.out.println("Exception: " + exp.getMessage()); | |
} |
GroupDocs.Assembly Java API 使程序员可以轻松处理与文档管理相关的任务。 这是一个 Java 代码示例,它展示了软件程序员如何轻松地访问他们的 PowerPoint 演示文稿文档并在其中添加超链接。
// Supported file formats: https://docs.groupdocs.com/assembly/java/supported-document-formats/ | |
String strDocumentTemplate = "/Presentation Templates/Dynamic Hyperlink.pptx"; | |
String strDocumentReport = "/Presentation Reports/Dynamic Hyperlink.pptx"; | |
String uriExpression = "https://www.groupdocs.com/"; | |
String displayTextExpression = "GroupDocs"; | |
try | |
{ | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.assembleDocument(CommonUtilities.getDataPath(strDocumentTemplate), CommonUtilities.getOutPath(strDocumentReport), | |
new DataSourceInfo(uriExpression,"uriExpression"), | |
new DataSourceInfo(displayTextExpression,"displayTextExpression")); | |
} | |
catch (Exception exp) | |
{ | |
System.out.println("Exception: " + exp.getMessage()); | |
} |
GroupDocs.Assembly for Java 使软件开发人员只需几行 Java 代码就可以轻松地将超链接添加到他们的电子邮件中。 以下示例演示了开发人员如何轻松地在其电子邮件文档中插入超链接并发送给他们自己的 Java 应用程序中的其他用户。
// Supported file formats: https://docs.groupdocs.com/assembly/java/supported-document-formats/ | |
String strDocumentTemplate = "/Email Templates/Dynamic Hyperlink.msg"; | |
String strDocumentReport = "/Email Reports/Dynamic Hyperlink.msg"; | |
String uriExpression = "https://www.groupdocs.com/"; | |
String displayTextExpression = "GroupDocs"; | |
try | |
{ | |
DocumentAssembler assembler = new DocumentAssembler(); | |
assembler.assembleDocument(CommonUtilities.getDataPath(strDocumentTemplate), CommonUtilities.getOutPath(strDocumentReport), | |
new DataSourceInfo(uriExpression,"uriExpression"), | |
new DataSourceInfo(displayTextExpression,"displayTextExpression")); | |
} | |
catch (Exception exp) | |
{ | |
System.out.println("Exception: " + exp.getMessage()); | |
} |
所有主要平台和操作系统都支持 GroupDocs.Assembly Java API。 它可以生成 Microsoft Word、Excel、PowerPoint、Outlook、OpenOffice 和 50 多种其他格式的文档。 如需完整的系统要求指南,请访问 系统要求 在执行以下代码之前,请确保您已安装以下先决条件 系统:
(Portable Document Format)
(Hyper Text Markup Language)
(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)
(OpenDocument Spreadsheet)
(Microsoft PowerPoint 97-2003)
(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)