如何拆分docx文件并将其每页插入数据库? [英] How do I split docx file and insert each page of it into database?

查看:99
本文介绍了如何拆分docx文件并将其每页插入数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用Visual Studio 2010,C#。



我有一些Word文件。

我想要将 Word文件的每页插入数据库中的记录。



如何拆分Word文件每一页?




在以下示例中,文本字段必须包含 text <每页的格式化



示例:::

Hi I am using Visual Studio 2010, C#.

I have some Word files.
I want to insert each page of Word files into a record from the database.

How do I split the Word file on every page?


In the following example, "Text field" must contain text and formatting of each page.

Sample:::

CREATE TABLE [Book] (
  [id] integer NOT NULL PRIMARY KEY AUTOINCREMENT,
  [Section] nvarchar(50) NOT NULL,
  [Chapter] nvarchar(50) NOT NULL,
  [PageNumber] int NOT NULL,

  [Text] ntext NOT NULL,

  [Refrence] ntext NOT NULL,
  [KeyWords] ntext NOT NULL);





非常感谢您的提示。



Thank you very much for your tips.

推荐答案

Word文档不包含页面,但文本流程...

页面 [ ^ ]你可以在 Word对象模型 [ ^ ]不代表容器,而是代表格式化的可视化块。

作为内容部分内容的页面获取只有在文档的实际渲染(可视化)之后才有意义......那就是Word文档在不同的计算机上可能会有很大差异的原因(相比之下或PDF)...

所以,你不能从word文档中读取页面 - 它们不在那里......
Word document do not contain pages, but a text flow...
The Page[^] object you can find in the Word Object Model[^] does not represent a container, but a visual block of formatting.
The Page as container of part of the content get meaning only after the actual rendering (visualization) of the document...That the reason that Word document can be very different on different computers (in contrast or PDF)...
So, you can not read pages from a word document - they are not there...


这篇关于如何拆分docx文件并将其每页插入数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆