C#代码,用于将多个word文档合并为1个word文档,文档名称为Index

编程入门 行业动态 更新时间:2024-10-26 04:25:12
本文介绍了C#代码,用于将多个word文档合并为1个word文档,文档名称为Index的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

要求 - aprox 20个单词文档,应将其转换为单个文档,文档名称为标题。在输出文档中,如果有人点击索引,它应该导航到该特定文档。

Requirement- aprox 20 word documents which should be converted as a single document with document name as heading. In the output document if anyone clicks on index it should navigate to that specific document.

推荐答案

你提到你正在使用iTextSharp来合并文档,但是如何你有没有设法做到这一点? iTextSharp只能合并PDF文件,而不能合并Word文件。 您是否要求将多个Word文档合并为一个PDF文档? 然而问题仍然存在,您究竟是如何合并这些Word文档的? 如果你我可以提供这些信息,然后我将向您展示如何在每个合并文档的开头创建书签,以及如何创建超链接,单击该链接将跳转到所需的书签位置。您还可以在这些书签中放置与文档名称相同的文本内容。 另外,正如您所考虑的那样,您考虑创建TOC(目录表)元素并且在每个合并文档的开头放置一个带有文档名称文本的标题1段落? 我不确定这是否符合您的需求,因为其他文档内容可能会弄乱TOC的条目。 You mentioned that you're using the iTextSharp to merge the documents, but how did you manage to do that? The iTextSharp is capable of merging only the PDF files, not Word files. Is your requirement to merge multiple Word documents into a single PDF document? Nevertheless the question still remains, how exactly are you merging those Word documents? If you can provide that information then I'll show you how you can create bookmarks at the start of each merged document and how you can create a hyperlink that when clicked will jump to the required bookmark's place. You would also place a text content equal to the document's name in those bookmarks. Also just as an FYI did you consider creating a TOC (Table of Content) element and placing a "Heading 1" paragraph with a document's name text at the beginning of each merged document? I'm not sure if this would suite your needs because the other documents content could mess up the TOC's entries.

它不是那样的工作。 我们不为你工作。 如果你想要某人要写你的代码,你必须付钱 - 我建议你去Freelancer并在那里问。 但要注意:你得到你付出的代价。支付花生,买猴子。 It doesn't quite work like that. We do not do your work for you. If you want someone to write your code, you have to pay - I suggest you go to Freelancer and ask there. But be aware: you get what you pay for. Pay peanuts, get monkeys.

更多推荐

C#代码,用于将多个word文档合并为1个word文档,文档名称为Index

本文发布于:2023-10-23 22:31:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1522191.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文档   多个   并为   代码   word

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!