为什么只将一些页码存储在docx文件的XML中? [英] Why only some page numbers stored in XML of docx file?

查看:285
本文介绍了为什么只将一些页码存储在docx文件的XML中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页脚中添加了一些页码.它在文档中正确可见.但是,如果我解压缩docx并检查footer.xml,则仅存在一些随机页码.那么MS-Word如何能够正确显示页码以及将所有页码存储在何处?

I have added some page number in footer. It is visible in document properly. But if i unzip docx and check the footer.xml only some random page numbers are there. so how MS-Word is able to display page numbers properly, And where it store all page numbers?

推荐答案

在Word Open XML文档中存储哪些页码没有逻辑.基本上,您在Word Open XML页眉/页脚部分中看到的页码是没有意义的,因为打开文档时它们将自动重新生成,并且很可能无法反映实际的分页.

There's no logic as to which page numbers are stored in a Word Open XML document. Basically, the page numbers you see in the Word Open XML header/footer section are meaningless as they'll be regenerated automatically when the document is opened and may well not reflect the actual paging.

Word中的所有动态内容(例如页码)均由字段管理.字段基本上由两部分组成:字段代码和字段结果.您可以在Word Open XML中看到此结构.

All dynamic content in Word, such as page numbering, is managed by fields. A field basically has two parts: the field code and the field result. You can see this structure in the Word Open XML.

根据字段类型及其位置,字段将自动更新,或者需要显式更新.页眉/页脚区域中的PAGE字段会自动更新,这在Word UI的整个编辑过程中几乎都是如此.

Depending on the field type and its location, fields will be updated automatically OR will require explicit updating. PAGE fields in the header/footer area update automatically, pretty much during the entire editing experience in the Word UI.

对于需要显式更新的字段,Word通常会将最后结果存储在文档中.但是,Word自动更新的字段可能会或可能不会存储最后的结果.另外,不能保证下一次打开文档或对其进行编辑时,存储的结果将是正确的.打开文档时,页面布局可能会随着流体的变化而变化,具体取决于单台机器.因此,您无法保证在Open XML中看到的任何页码在打开文档时都位于同一位置.

For fields that need to be updated explicitly, Word will usually store the last result in the document. But fields that Word updates automatically may or may not store the last result. PLUS there's no guarantee that the stored result will be correct when the document is opened the next time, or if it's edited. Depending on the individual machine, page layout can change fluidly when a document is opened. So any page numbers you see in the Open XML are no guarantee to be in the same place when a document is opened.

总页数,但是存储在文档属性中的可以正确-也取决于下次打开文档时页面布局的完成方式

The total number of pages, however, that's stored in the document properties could be correct - also depending on how the page layout is done when the document is next opened.

以下文章包含有关字段更新的一些相关信息:

The following article contains some relevant information on field updating: https://support.microsoft.com/en-us/help/211629/which-fields-are-updated-when-you-open--repaginate--or-print-document

这篇关于为什么只将一些页码存储在docx文件的XML中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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